Expand description
Portable file operations and allocation measurements.
Clone and copy helpers keep native filesystem calls behind one API.
Measurements distinguish logical length, allocated bytes and private
extents. Unknown private allocation stays None; directory totals carry
a confidence level and account for hardlinks through an inode ledger.
Callers own file placement, permissions policy and deletion decisions.
Structs§
- Clone
Sketch - A bounded sample of the clone groups a directory’s files belong to.
- DirSizing
- Aggregate over a directory.
- File
Sizing - What one file costs, and what dies with it.
- InodeId
- Filesystem-unique file identity.
- Inode
Ledger - Probe
Caps - What a platform probe can actually report.
- Volume
Usage - Free and total bytes on the volume holding a path.
Enums§
- Confidence
- How much to trust an aggregate.
- DirEntry
- One entry of a directory as a probe reports it, already classified.
- Sharing
- How a file’s blocks are shared with other files.
Traits§
Functions§
- copy_
writable - Copy bytes and set a writable destination mode (0644 or 0755 on Unix).
On Windows this clears the destination’s read-only attribute.
Like
std::fs::copy, this can overwrite an existing destination. The caller must ensure that doing so cannot modify a file shared through a hardlink. - directory_
identity - Identity of a directory. A symlink at the final component is rejected.
- file_
identity - Identity of the object at
path, following symlinks. Valid for comparing live objects on this host; an inode can be reused after deletion. - handle_
identity - Identity of the file an open handle refers to, whatever its path names
now. Compared with
file_identityit tells whether the path was unlinked or replaced after the handle was opened. - measure_
file - Measure one file without running a separate capability probe first. Missing or unreadable files return an error; unavailable sharing information remains unknown in the returned measurement.
- probe_
for - Best probe for the filesystem holding
path. - read_
dir_ one_ by_ one - The portable directory reader: names from
read_dir, one probe per file. - set_
writable_ permissions - Set 0644 or 0755 on Unix; clear the read-only attribute on other platforms. This changes inode metadata and therefore also affects any hardlink aliases.
- try_
clone_ extents_ into - Share
srcdata into an existing writabledstfile. - try_
reflink - Clone data into a new destination using the filesystem’s copy-on-write API.
Existing destinations are never replaced. An unsupported filesystem returns
an error so the caller can choose its fallback. This never creates a hardlink.
Metadata follows the native clone operation; use
set_writable_permissionswhen the destination needs a specified writable mode. - volume_
usage - Volume usage for the filesystem holding
path.