|
RPV Event driven kernel
|
File system middleware interface called by file I/O subsystem. More...
#include <stddef.h>#include <stdint.h>#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
| struct | fildatetime_t |
| FAT timestamp structure. More... | |
| struct | filinfo_t |
| File information structure. More... | |
Macros | |
| #define | MAX_FILE_NAME (256) |
| Maximum file name length (including null terminator). | |
Enumerations | |
| enum | file_access_t { FILE_READ = 0x01 , FILE_WRITE = 0x02 , FILE_CREATE = 0x08 , FILE_CREATE_NEW = 0x04 , FILE_APPEND = 0x30 } |
| File access mode flags. More... | |
| enum | fat_error_code_t { FAT_OK , FAT_IO_ERROR , FAT_NOT_FOUND , FAT_ACCESS_DENIED , FAT_ERR_NOTSET } |
| FAT filesystem error codes. More... | |
Functions | |
| void | fat_getcwd (char *cwd) |
| Retrieves current working directory path. | |
| bool | fat_exists (char const *path) |
| Checks whether a file or directory exists. | |
| bool | fat_chdir (char const *cwd) |
| Changes current working directory. | |
| bool | fat_mkdir (char const *path) |
| Creates a new directory. | |
| bool | fat_unlink (char const *path) |
| Removes a file or directory. | |
| bool | fat_mount (char const *path) |
| Mounts a FAT filesystem. | |
| bool | fat_unmount (char const *path) |
| Unmounts a FAT filesystem. | |
| bool | fat_stat (char const *path, filinfo_t *fno) |
| Retrieves file or directory metadata. | |
| fat_error_code_t | fat_getcode (void) |
| Returns last FAT error code. | |
| void | fat_fclose (int fd) |
| Closes an open file descriptor. | |
| int | fat_fopen (char const *path, file_access_t mode) |
| Opens a file. | |
| size_t | fat_fsize (int fd) |
| Returns file size. | |
| size_t | fat_fread (int fd, void *buffer, size_t nread) |
| Reads data from file. | |
| size_t | fat_fwrite (int fd, void const *buffer, size_t nwrite) |
| Writes data to file. | |
| void | fat_ls (char const *path, void const *ls_ctx, void(*nxt_file)(void const *ls_ctx, filinfo_t const *fi)) |
| Lists directory contents. | |
File system middleware interface called by file I/O subsystem.
| enum fat_error_code_t |
FAT filesystem error codes.
Provides detailed error status retrievable via fat_getcode().
| Enumerator | |
|---|---|
| FAT_OK | Operation successful. |
| FAT_IO_ERROR | Low-level disk I/O error. |
| FAT_NOT_FOUND | File or directory not found. |
| FAT_ACCESS_DENIED | Permission denied. |
| FAT_ERR_NOTSET | No error set. |
| enum file_access_t |
File access mode flags.
Bitmask flags used when opening a file via fat_fopen(). Flags may be combined unless otherwise restricted.