oa::Filesystem

Stateless host-filesystem operations. All methods are free functions on &Path. There is no instance state. Matches the surface of oa::Filesystem in C++ and its Python bindings so that cross-language code reads identically: ⓘFilesystem::create_directories(output.parent().unwrap())?; let text = Filesystem::read_text(&config_path)?;

StRust public API

Declaration

pub struct Filesystem;
Public Rust declaration.

Associated Functions

pub fn exists(path: &Path) -> bool
pub fn is_file(path: &Path) -> bool
pub fn is_directory(path: &Path) -> bool
pub fn get_file_size(path: &Path) -> Result<u64>
pub fn get_last_modified(path: &Path) -> Result<i64>
pub fn create_directory(path: &Path) -> Result<()>
pub fn create_directories(path: &Path) -> Result<()>
pub fn remove_file(path: &Path) -> Result<()>
pub fn remove_directory(path: &Path, recursive: bool) -> Result<()>
pub fn copy(from: &Path, to: &Path) -> Result<()>
pub fn move_path(from: &Path, to: &Path) -> Result<()>
pub fn list_files(dir: &Path, extension: &str) -> Result<Vec<PathBuf>>
pub fn list_directories(dir: &Path) -> Result<Vec<PathBuf>>
pub fn list_all(dir: &Path, recursive: bool) -> Result<Vec<PathBuf>>
pub fn read_text(path: &Path) -> Result<String>
pub fn write_text(path: &Path, content: &str) -> Result<()>
pub fn append_text(path: &Path, content: &str) -> Result<()>
pub fn read_lines(path: &Path) -> Result<Vec<String>>
pub fn read_binary(path: &Path) -> Result<Vec<u8>>
pub fn write_binary(path: &Path, data: &[u8]) -> Result<()>
pub fn absolute(path: &Path) -> Result<PathBuf>
pub fn glob(dir: &Path, pattern: &str) -> Result<Vec<PathBuf>>

Public Method Documentation

pub fn exists( path: &Path ) -> bool
No public source comment is attached to this declaration.
pub fn is_file( path: &Path ) -> bool
No public source comment is attached to this declaration.
pub fn is_directory( path: &Path ) -> bool
No public source comment is attached to this declaration.
pub fn get_file_size( path: &Path ) -> Result<u64>
No public source comment is attached to this declaration.
pub fn get_last_modified( path: &Path ) -> Result<i64>
No public source comment is attached to this declaration.
pub fn create_directory(path: &Path) -> Result<()>
No public source comment is attached to this declaration.
pub fn create_directories(path: &Path) -> Result<()>
No public source comment is attached to this declaration.
pub fn remove_file(path: &Path) -> Result<()>
No public source comment is attached to this declaration.
pub fn remove_directory(path: &Path, recursive: bool) -> Result<()>
No public source comment is attached to this declaration.
pub fn copy(from: &Path, to: &Path) -> Result<()>
No public source comment is attached to this declaration.
pub fn move_path(from: &Path, to: &Path) -> Result<()>
No public source comment is attached to this declaration.
pub fn list_files( dir: &Path, extension: &str ) -> Result<Vec<PathBuf>>
No public source comment is attached to this declaration.
pub fn list_directories( dir: &Path ) -> Result<Vec<PathBuf>>
No public source comment is attached to this declaration.
pub fn list_all( dir: &Path, recursive: bool ) -> Result<Vec<PathBuf>>
No public source comment is attached to this declaration.
pub fn read_text( path: &Path ) -> Result<String>
No public source comment is attached to this declaration.
pub fn write_text(path: &Path, content: &str) -> Result<()>
No public source comment is attached to this declaration.
pub fn append_text(path: &Path, content: &str) -> Result<()>
No public source comment is attached to this declaration.
pub fn read_lines( path: &Path ) -> Result<Vec<String>>
No public source comment is attached to this declaration.
pub fn read_binary( path: &Path ) -> Result<Vec<u8>>
No public source comment is attached to this declaration.
pub fn write_binary(path: &Path, data: &[u8]) -> Result<()>
No public source comment is attached to this declaration.
pub fn absolute( path: &Path ) -> Result<PathBuf>
No public source comment is attached to this declaration.
pub fn glob( dir: &Path, pattern: &str ) -> Result<Vec<PathBuf>>
No public source comment is attached to this declaration.