distrax.utils.fileio.recursive_change_ownership#

distrax.utils.fileio.recursive_change_ownership(path, user, group, admin=False)[source]#

Recursively change the ownership of a directory and the files within.

Parameters:
  • path (str) – path of directory to change ownership of

  • user (str) – the user to change ownership to

  • group (str) – the group to change ownership to

  • admin (bool) – To run under escalted privileges

Return type:

bool

Returns:

True if successful else False

Examples

>>> distrax.utils.fileio.recursive_change_ownership("folder", "usr", "grp")
True
>>> distrax.utils.fileio.recursive_change_ownership("no_folder","usr", "grp")
False