Expand description
Local filesystem primitives for paths, files, directories, links, permissions, temporary files, and file trees.
This crate intentionally stays below storage abstractions. Higher-level
crates such as rskit-storage, rskit-cache, and rskit-httpclient use
these primitives instead of each reimplementing path safety, temp files, and
atomic file replacement.
Security defaults:
- use
path::safe_joinfor user-provided relative paths before touching disk; - sync tree copy/list operations do not follow symlinks unless explicitly requested;
- use
async_io::file::write_atomicorsync_io::file::write_atomicfor same-filesystem writes without exposing partial files, andwrite_atomic_replacewhen existing files should be replaced (existing-file replacement is atomic on Unix-like platforms; Windows replacement removes the destination before renaming because the platform rename operation cannot replace an existing file); - use
permissionscapability checks before performing optional user-facing operations when theasyncfeature is enabled.
Re-exports§
pub use app_dirs::app_cache_dir;pub use path::SafePathError;pub use path::absolute;pub use path::canonicalize;pub use path::confine_existing_path;pub use path::confine_path;pub use path::parent_dir;pub use path::resolve_root_relative_to;pub use path::safe_join;pub use path::validate_relative_path;pub use temp::TempDir;pub use temp::TempFile;pub use temp::sibling_temp_path;
Modules§
- app_
dirs - Platform application directory helpers. Platform application directory helpers.
- async_
io - Async filesystem operations. Async filesystem operations.
- link
- Async hard-link and symbolic-link helpers. Hard-link and symbolic-link helpers.
- path
- Safe path helpers. Safe path helpers.
- permissions
- Permission and capability helpers. Permission and capability helpers.
- sync_io
- Synchronous filesystem operations. Synchronous filesystem operations.
- temp
- Temporary file and path helpers. Temporary file and path helpers.