Go to the source code of this file.
|
| MTSTATUS | vfs_init (void) |
| | Initialize the Virtual File System (initializes other filesystem needed services as well)
|
| MTSTATUS | vfs_read (const char *filename, uint32_t *file_size_out, void **buffer_out) |
| | Reads the file into a buffer.
|
| MTSTATUS | vfs_write (const char *path, const void *data, uint32_t size, FS_WRITE_MODES write_mode) |
| | Creates a new file (or opens existing) and writes data to it.
|
| MTSTATUS | vfs_delete (const char *path) |
| | This function deletes the file given to the function from the system.
|
| MTSTATUS | vfs_listdir (const char *path, char *listings, size_t max_len) |
| | Lists the directory given.
|
| MTSTATUS | vfs_mkdir (const char *path) |
| | Creates a new directory.
|
| MTSTATUS | vfs_rmdir (const char *path) |
| | This function deletes the directory given to the function from the system along with its file (marks as deleted).
|
| bool | vfs_is_dir_empty (const char *path) |
| | This function returns if the directory given to the function is empty (e.g, has only '.' and '..' entries / is nonexistent / is deleted)
|
| void | vfs_listrootdir (void) |
| | This function will list the root directory of the main mount device.
|
◆ FS_DRIVER
| typedef struct FS_DRIVER FS_DRIVER |
◆ FS_WRITE_MODES
◆ _FS_WRITE_MODES
| Enumerator |
|---|
| WRITE_MODE_APPEND_EXISTING | |
| WRITE_MODE_CREATE_OR_REPLACE | |
Definition at line 13 of file vfs.h.
◆ vfs_delete()
| MTSTATUS vfs_delete |
( |
const char * | path | ) |
|
This function deletes the file given to the function from the system.
- Parameters
-
| path | Full path to delete file. |
- Returns
- MTSTATUS Status code.
Definition at line 101 of file vfs.c.
◆ vfs_init()
Initialize the Virtual File System (initializes other filesystem needed services as well)
- Returns
- MTSTATUS Status Code
Definition at line 42 of file vfs.c.
◆ vfs_is_dir_empty()
| bool vfs_is_dir_empty |
( |
const char * | path | ) |
|
This function returns if the directory given to the function is empty (e.g, has only '.' and '..' entries / is nonexistent / is deleted)
- Parameters
-
- Returns
- True or false based if empty or not.
Definition at line 129 of file vfs.c.
◆ vfs_listdir()
| MTSTATUS vfs_listdir |
( |
const char * | path, |
|
|
char * | listings, |
|
|
size_t | max_len ) |
Lists the directory given.
- Parameters
-
| path | Path to directory, e.g "mydir/" |
| listings | [OUT] Pointer to directory listing. (each seperated with a newline character) |
| max_len | [IN] Max size of listings buffer. |
- Returns
- MTSTATUS Status code.
Definition at line 108 of file vfs.c.
◆ vfs_listrootdir()
| void vfs_listrootdir |
( |
void | | ) |
|
This function will list the root directory of the main mount device.
Definition at line 136 of file vfs.c.
◆ vfs_mkdir()
Creates a new directory.
- Parameters
-
| path | The full path to the new directory |
- Returns
- MTSTATUS Status code.
Definition at line 115 of file vfs.c.
◆ vfs_read()
| MTSTATUS vfs_read |
( |
const char * | filename, |
|
|
uint32_t * | file_size_out, |
|
|
void ** | buffer_out ) |
Reads the file into a buffer.
- Parameters
-
| filename | The Filename to read, e.g "file.txt" or "tmp/folder/myfile.txt" |
| file_size_out | A pointer to put the file size in bytes |
| bufferOut | A pointer to put the file buffer in (doesn't need to be dynamically allocated) |
- Returns
- MTSTATUS Status Code.
Definition at line 87 of file vfs.c.
◆ vfs_rmdir()
This function deletes the directory given to the function from the system along with its file (marks as deleted).
- Parameters
-
| path | Full path to delete directory. |
- Returns
- MTSTATUS Status code.
Definition at line 122 of file vfs.c.
◆ vfs_write()
Creates a new file (or opens existing) and writes data to it.
- Parameters
-
| path | The full path of the file to create |
| data | A pointer to the data to write. |
| size | The number of bytes to write |
| write_mode | Whether to APPEND or CREATE/REPLACE the file. (in FS_WRITE_MODES enum) |
- Returns
- MTSTATUS Status Code
Definition at line 94 of file vfs.c.