Skip to main content

Module fs

Module fs 

Source
Expand description

Safe, idiomatic wrappers for CFE File Services (CFE_FS) and OSAL file APIs.

This module provides a File struct that acts as a safe handle for file operations, ensuring that files are closed when they go out of scope. It also provides wrappers for standalone filesystem operations like mkdir and remove.

Structs§

Directory
A handle to an open directory.
File
A handle to an open file.
FileMode
File permission modes for fs::chmod.
FileProp
Properties of an open file, returned by File::info.
FileStat
A structure containing metadata about a file.
FileWriteMetaData
Metadata and state for a background file write operation.
FsHeader
A safe, idiomatic wrapper for a cFE file header.
FsInfo
Statistics about the overall file system.
StatVfs
A structure containing statistics about a filesystem volume.

Enums§

AccessMode
File access modes for opening or creating a file.
FileCategory
Generalized file types/categories known to FS.
SeekFrom
Defines the origin for a seek operation, used by File::seek.

Functions§

add_fixed_map
Creates a fixed mapping between a physical host path and a virtual OSAL mount point.
background_file_dump_request
Registers a background file dump request with Executive Services.
check_fs
Checks the health of a file system and optionally repairs it.
chmod
Changes the permission mode of a file.
close_all_files
Closes all files that were opened through OSAL.
close_file_by_name
Closes a file by its filename.
cp
Copies a single file from src to dest.
extract_filename_from_path
Extracts the filename from a unix style path and filename string.
get_default_extension
Gets the default filename extension for a file category (e.g., “.so” or “.log”).
get_default_mount_point
Gets the default virtual mount point for a file category (e.g., “/ram” or “/cf”).
get_fs_info
Retrieves information about the overall file system.
get_phys_drive_name
Gets the physical drive name associated with a virtual mount point.
init_fs
Initializes an existing file system on the target.
is_background_file_dump_pending
Checks if a background file dump request is currently pending.
is_file_open
Checks if a file with the given name is currently open.
make_fs
Creates a new file system on a block device or in memory.
mkdir
Creates a new directory.
mount
Mounts a file system to a virtual mount point.
mv
Moves a single file from src to dest.
parse_input_filename
Parses a filename from an input string, applying default path and extension.
remove
Removes a file from the file system.
remove_fs
Removes a file system mapping from OSAL.
rename
Renames a file.
rmdir
Removes an empty directory.
stat
Retrieves metadata for a file or directory at a given path.
statvfs
Retrieves statistics about a filesystem volume.
translate_path
Translates an OSAL virtual path to a host-specific local path.
unmount
Unmounts a file system.