flowtool.files¶
-
flowtool.files.
find_parent_containing
(name, path=None, check='exists', not_found=None)[source]¶ Return the nearest directory in the parent dirs of path, that contains name, or None if no such parent dir exists. The check can be customized/chosen from exists, isfile and isdir.
-
flowtool.files.
find_subdirs_containing
(name, path=None, check='exists', checklist=<function <lambda>>, not_found=None)[source]¶ Return the subdirectories containind name. The check can be chosen from exists, (is)file and (is)dir.
-
flowtool.files.
check_file
(path, for_content)[source]¶ Check wether a file contains a substring. Might be inefficient on large files.
-
flowtool.files.
is_executable
(filename)[source]¶ Check wether a file has the executable bit set (for the owner).