fs.tools¶
Miscellaneous tools for operating on filesystems.
-
fs.tools.copy_file_data(src_file, dst_file, chunk_size=None)[source]¶ Copy data from one file object to another.
Parameters: - src_file (io.IOBase) – File open for reading.
- dst_file (io.IOBase) – File open for writing.
- chunk_size (int) – Number of bytes to copy at
a time (or
Noneto use sensible default).
-
fs.tools.get_intermediate_dirs(fs, dir_path)[source]¶ Get a list of non-existing intermediate directories.
Parameters: - fs (FS) – A filesystem instance.
- dir_path (str) – A path to a new directory on the filesystem.
Returns: A list of non-existing paths.
Return type: list
Raises: DirectoryExpected– If a path component references a file and not a directory.