append
fs::append(path, contents)Append contents (string or bytes) to path. Creates the file if missing.
Filesystem I/O. Sync (`std::fs`) or async (`tokio::fs`) impl picked by the build's runtime feature.
appendfs::append(path, contents)Append contents (string or bytes) to path. Creates the file if missing.
append_randomfs::append_random(path, count) -> intAppend count random bytes to path; returns bytes appended. Creates the file if missing.
canonicalizefs::canonicalize(path) -> stringResolve symlinks and normalise path against the filesystem.
copyfs::copy(from, to) -> intCopy from to to; returns bytes copied.
create_dirfs::create_dir(path)Create a single directory. Errors if any parent is missing.
create_dir_allfs::create_dir_all(path)Create the directory and any missing parents.
existsfs::exists(path) -> boolTrue if path exists.
is_dirfs::is_dir(path) -> boolTrue if path is an existing directory.
is_filefs::is_file(path) -> boolTrue if path is an existing regular file.
list_dirfs::list_dir(path) -> list<string>Names of the entries directly inside the directory at path (non-recursive).
metadatafs::metadata(path) -> dictReturn #{size, is_file, is_dir, readonly, modified}.
pad_randomfs::pad_random(path, target_size) -> intGrow path to target_size with random bytes; returns bytes appended.
readfs::read(path) -> stringRead the file at path as UTF-8 text.
read_bytesfs::read_bytes(path) -> bytesRead the file at path as raw bytes.
remove_dirfs::remove_dir(path)Delete the directory at path. Errors if not empty.
remove_dir_allfs::remove_dir_all(path)Recursively delete the directory at path and all its contents.
remove_filefs::remove_file(path)Delete the file at path.
renamefs::rename(from, to)Rename / move from to to.
writefs::write(path, contents)Write contents (string or bytes) to path, replacing the existing file.