fs module¶
file_utilities¶
- py_utilities.fs.file_utilities.concat(file_paths, file)[source]¶
Concatenates contents in file_paths list to a file-like object, file
- py_utilities.fs.file_utilities.copy_file(file_path, file=<open file '<stdout>', mode 'w' at 0x103690150>)[source]¶
Copy contents at file_path to a file-like object, file
- py_utilities.fs.file_utilities.crc32(file_path)[source]¶
Computes cyclic redundancy check checksum of the contents of file_path
- py_utilities.fs.file_utilities.file_ext(file_path)[source]¶
Returns the file extension at file_path
>>> file_ext('/foo/bar/what/temp.txt') '.txt'
>>> file_ext('/foo/bar/what/temp.jpg') '.jpg'
>>> file_ext('/foo/bar/what/temp.tar.gz') '.gz'
>>> file_ext('/foo/bar/what/temp') ''
>>> file_ext('') ''
fs_utilities¶
- py_utilities.fs.fs_utilities.mkdir_p(path)[source]¶
Recursive directory creation function. Mimics mkdir -p. Doesn’t raise an error if the leaf exists and is a directory.
Reference: http://stackoverflow.com/questions/600268/ mkdir-p-functionality-in-python/600612#600612