fs.move

Functions for moving files between filesystems.

fs.move.move_dir(src_fs: Text | FS, src_path: Text, dst_fs: Text | FS, dst_path: Text, workers: int = 0, preserve_time: bool = False) None[source]

Move a directory from one filesystem to another.

Parameters:
  • src_fs (FS or str) – Source filesystem (instance or URL).

  • src_path (str) – Path to a directory on src_fs

  • dst_fs (FS or str) – Destination filesystem (instance or URL).

  • dst_path (str) – Path to a directory on dst_fs.

  • workers (int) – Use worker threads to copy data, or 0 (default) for a single-threaded copy.

  • preserve_time (bool) – If True, try to preserve mtime of the resources (defaults to False).

fs.move.move_file(src_fs: Text | FS, src_path: Text, dst_fs: Text | FS, dst_path: Text, preserve_time: bool = False, cleanup_dst_on_error: bool = True) None[source]

Move a file from one filesystem to another.

Parameters:
  • src_fs (FS or str) – Source filesystem (instance or URL).

  • src_path (str) – Path to a file on src_fs.

  • dst_fs (FS or str) – Destination filesystem (instance or URL).

  • dst_path (str) – Path to a file on dst_fs.

  • preserve_time (bool) – If True, try to preserve mtime of the resources (defaults to False).

  • cleanup_dst_on_error (bool) – If True, tries to delete the file copied to dst_fs if deleting the file from src_fs fails (defaults to True).

fs.move.move_fs(src_fs: Text | FS, dst_fs: Text | FS, workers: int = 0, preserve_time: bool = False) None[source]

Move the contents of a filesystem to another filesystem.

Parameters:
  • src_fs (FS or str) – Source filesystem (instance or URL).

  • dst_fs (FS or str) – Destination filesystem (instance or URL).

  • workers (int) – Use worker threads to copy data, or 0 (default) for a single-threaded copy.

  • preserve_time (bool) – If True, try to preserve mtime of the resources (defaults to False).