Skip to main content

Module file

Module file 

Source
Expand description

File system operations module for C API

Provides C-compatible wrappers around Rust’s std::fs API. This allows C code to use Rust’s file operations without importing stdio.h.

Structs§

DirEntry
A directory entry
DirEntryVec
FileError
Error when performing file operations
FileMetadata
Metadata about a file
FilePath
FFI-safe path type with OOP-style methods

Enums§

DirEntryVecDestructor
FileErrorKind
Kind of file error
FileType
File type (file, directory, symlink)
OptionFilePath
ResultDirEntryVecFileError
ResultFileMetadataFileError
ResultFilePathFileError
ResultStringFileError
ResultU8VecFileError
ResultVoidFileError
Resultu64FileError

Functions§

dir_create
Create a directory
dir_create_all
Create a directory and all parent directories
dir_delete
Delete an empty directory
dir_delete_all
Delete a directory and all its contents
dir_list
List directory contents
file_append
Append bytes to a file
file_copy
Copy a file
file_delete
Delete a file
file_metadata
Get file metadata
file_read
Read a file to bytes
file_read_string
Read a file to string (UTF-8)
file_rename
Rename/move a file
file_write
Write bytes to a file (creates or overwrites)
file_write_string
Write string to a file (creates or overwrites)
path_canonicalize
Canonicalize a path (resolve symlinks, make absolute)
path_exists
Check if a file or directory exists
path_extension
Get the file extension from a path
path_file_name
Get the file name from a path
path_is_dir
Check if path is a directory
path_is_file
Check if path is a file
path_join
Join two paths
path_parent
Get the parent directory of a path
temp_dir
Get the system temporary directory
temp_file_create
Create a temporary file and return its path

Type Aliases§

DirEntryVecDestructorType