Expand description
File utilities for CoderLib
Functions§
- create_
backup - Create a backup of a file
- find_
files_ by_ pattern - Find files matching a pattern in a directory
- get_
file_ extension - Get file extension in lowercase
- get_
file_ size - Get the size of a file in bytes
- get_
mime_ type - Get the MIME type of a file based on its extension
- get_
relative_ path - Get the relative path from one path to another
- get_
temp_ file_ path - Get a temporary file path with the given extension
- has_
allowed_ extension - Check if a file has one of the allowed extensions
- is_
accessible_ directory - Check if a directory exists and is accessible
- is_
readable_ file - Check if a file exists and is readable
- is_
safe_ path - Check if a path is safe (doesn’t contain dangerous patterns)
- is_
text_ file - Check if a file is a text file based on its extension
- is_
within_ size_ limit - Check if a file is within size limits
- normalize_
path - Normalize a path by resolving . and .. components