distrax.utils.fileio.copy_file#

distrax.utils.fileio.copy_file(src, dest, admin=False)[source]#

Copy a file from src to dest.

Maintaining Permissions but no other metadata.

Parameters:
  • src (str) – path to the file that will be copied

  • dest (str) – Destination of the file

  • admin (bool) – To run under escalted privileges

Return type:

bool

Returns:

True if successful else False

Examples

>>> distrax.utils.fileio.copy_file("file_exists", "./new_file")
True
>>> distrax.utils.fileio.copy_file("non_existent_file", "./new_file")
False