Skip to main content

Crate rskit_fs

Crate rskit_fs 

Source
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_join for user-provided relative paths before touching disk;
  • sync tree copy/list operations do not follow symlinks unless explicitly requested;
  • use async_io::file::write_atomic or sync_io::file::write_atomic for same-filesystem writes without exposing partial files, and write_atomic_replace when 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 permissions capability checks before performing optional user-facing operations when the async feature 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.

Structs§

DirEntry
Metadata for an entry directly inside a directory.
FileMeta
Metadata for a filesystem entry at a file path.