Skip to main content

Module fs_utils

Module fs_utils 

Source
Expand description

Filesystem helpers: path comparison, permission bits, symlink removal.

Functions§

make_executable
Sets executable permission bits (+x) on Unix; no-op on Windows.
remove_symlink_dir_like
Remove a path that is a symlink, handling the platform difference between symlinks to directories (Windows: remove_dir) and symlinks to files (Unix: remove_file). Returns Ok(false) if path is not a symlink.
same_content
Check whether two files have identical content. Returns false if either file doesn’t exist or can’t be read, or if their sizes differ (avoids reading content when lengths don’t match).
same_file
Check whether two paths refer to the same file on disk. Returns false if either path doesn’t exist or can’t be canonicalized.