#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "../../drivers/gop/gop.h"
#include "../../mtstatus.h"
Go to the source code of this file.
◆ DELETED_DIR_ENTRY
| #define DELETED_DIR_ENTRY 0xE5 |
◆ END_OF_DIRECTORY
| #define END_OF_DIRECTORY 0x00 |
◆ FAT32_BAD_CLUSTER
| #define FAT32_BAD_CLUSTER 0x0FFFFFF7U |
◆ FAT32_EOC_MAX
| #define FAT32_EOC_MAX 0x0FFFFFFFU /* inclusive */ |
◆ FAT32_EOC_MIN
| #define FAT32_EOC_MIN 0x0FFFFFF8U /* inclusive */ |
◆ FAT32_FAT_MASK
| #define FAT32_FAT_MASK 0x0FFFFFFFU |
◆ FAT32_FREE_CLUSTER
| #define FAT32_FREE_CLUSTER 0x00000000U |
◆ FAT32_ATTRIBUTES
◆ FAT32_FSINFO
◆ _FAT32_ATTRIBUTES
| Enumerator |
|---|
| ATTR_READ_ONLY | |
| ATTR_HIDDEN | |
| ATTR_SYSTEM | |
| ATTR_VOLUME_ID | |
| ATTR_DIRECTORY | |
| ATTR_ARCHIVE | |
| ATTR_LONG_NAME | |
Definition at line 113 of file fat32.h.
◆ __attribute__()
| struct __attribute__ |
( |
(packed) | | ) |
|
◆ fat32_create_directory()
| MTSTATUS fat32_create_directory |
( |
const char * | path | ) |
|
Creates a new directory (/testdir/ or /testdir are both allowed to create 'testdir' inside of 'root')
- Parameters
-
| path | The full path to the new directory |
- Returns
- MTSTATUS Status code.
Definition at line 1047 of file fat32.c.
◆ fat32_delete_directory()
| MTSTATUS fat32_delete_directory |
( |
const char * | path | ) |
|
This function deletes the directory given to the function from the system.
- Parameters
-
| path | Full path to delete directory. |
- Returns
- MTSTATUS Status code.
Definition at line 1922 of file fat32.c.
◆ fat32_delete_file()
| MTSTATUS fat32_delete_file |
( |
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 1954 of file fat32.c.
◆ fat32_directory_is_empty()
| bool fat32_directory_is_empty |
( |
const char * | path | ) |
|
This function returns if the directory given to the function is empty (e.g, has only '.' and '..' entries / deleted / nonexistent)
- Parameters
-
- Returns
- True or false based if empty or not.
Definition at line 1663 of file fat32.c.
◆ fat32_init()
◆ fat32_list_directory()
| MTSTATUS fat32_list_directory |
( |
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 1579 of file fat32.c.
◆ fat32_list_root()
| void fat32_list_root |
( |
void | | ) |
|
◆ fat32_read_file()
| MTSTATUS fat32_read_file |
( |
const char * | filename, |
|
|
uint32_t * | file_size_out, |
|
|
void ** | buffer_out ) |
A FAT32 Function that reads the file requested into a dynamically allocated 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 921 of file fat32.c.
◆ fat32_write_file()
| MTSTATUS fat32_write_file |
( |
const char * | path, |
|
|
const void * | data, |
|
|
uint32_t | size, |
|
|
uint32_t | file_modification_mode ) |
Creates a new file 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 |
| file_modification_mode | Whether to APPEND or REPLACE the file. (in FS_WRITE_MODES enum) |
- Returns
- MTSTATUS Status code.
Definition at line 1275 of file fat32.c.
◆ FAT32_BPB
◆ FAT32_DIR_ENTRY