5 #include <ctu_fs_api.h>
os_dirent_t
directory entry type
os_access_t
file access mode
#define STA_RELEASE
annotate a pointer as invalid after the function returns
#define CT_PUREFN
mark a function as pure, always returns the same value for the same arguments
#define CT_NODISCARD
mark a function as returning a value that must be used
#define IN_NOTNULL
annotate a parameter as not being null
#define IN_STRING
annotate a parameter as being a null terminated string
CT_NODISCARD CT_FS_API fs_t * fs_virtual(const char *name, arena_t *arena)
create a virtual filesystem interface
CT_PUREFN CT_FS_API os_dirent_t fs_inode_type(const fs_inode_t *inode)
get the type of an inode
CT_FS_API void fs_delete(STA_RELEASE fs_t *fs)
delete a filesystem handle
CT_NODISCARD CT_FS_API bool fs_dir_exists(fs_t *fs, const char *path)
query if a directory exists
CT_FS_API os_error_t fs_iter_begin(fs_t *fs, const fs_inode_t *node, OUT_NOTNULL fs_iter_t **iter)
begin iterating over a directory
CT_FS_API os_error_t fs_file_delete(fs_t *fs, const char *path)
delete a file
CT_NODISCARD CT_FS_API fs_t * fs_physical(const char *root, arena_t *arena)
create a filesystem interface to a physical location on disk
CT_NODISCARD CT_FS_API bool fs_file_exists(fs_t *fs, const char *path)
query if a file exists
CT_FS_API os_error_t fs_dir_delete(fs_t *fs, const char *path)
delete a directory delete a directory and all contained files and folders
CT_FS_API os_error_t fs_dir_create(fs_t *fs, const char *path)
create a directory create a directory and all child directories inside a filesystem
CT_FS_API fs_inode_t * fs_find_inode(fs_t *fs, const char *path)
find an inode in a filesystem
CT_FS_API os_error_t fs_iter_next(fs_iter_t *iter, OUT_NOTNULL fs_inode_t **inode)
get the next inode in an iteration
CT_NODISCARD CT_FS_API io_t * fs_open(fs_t *fs, const char *path, os_access_t flags)
open a file at a given location in the filesystem
CT_FS_API os_error_t fs_iter_end(fs_iter_t *iter)
end an iteration
CT_FS_API void fs_file_create(fs_t *fs, const char *path)
create a file
CT_PUREFN CT_FS_API bool fs_inode_is(const fs_inode_t *inode, os_dirent_t type)
check if a given inode is of a certain type
CT_PUREFN CT_FS_API const char * fs_inode_name(const fs_inode_t *inode)
get the name of an inode
CT_FS_API sync_result_t fs_sync(fs_t *dst, fs_t *src)
synchronize 2 filesystems copies all folders and files from src to dst
CT_PUREFN CT_FS_API fs_inode_t * fs_root_inode(fs_t *fs)
get the root inode of a filesystem
the result of a fs_sync call this is here because we cant use Compiler message notification in the fs...
const char * path
the file that failed to sync
a generic vector of pointers