Module fs

Source
Expand description

File system utilities

Functions§

ensure_dir
Create directories recursively with proper error handling
file_extension
Get file extension as lowercase string
file_size
Get file size safely
is_binary_file
Check if file is binary based on content
is_safe_path
Check if a path is safe to access (no directory traversal)
safe_canonicalize
Safely canonicalize a path, handling cases where the path doesn’t exist