fs.tools¶
Miscellaneous tools for operating on filesystems.
- fs.tools.copy_file_data(src_file: IO, dst_file: IO, chunk_size: int | None = None) 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
None
to use sensible default).
- fs.tools.get_intermediate_dirs(fs: FS, dir_path: Text) List[Text] [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.