sd-reader
|
FAT header (license: GPLv2 or LGPLv2.1) More...
Data Structures | |
struct | fat_dir_entry_struct |
Describes a directory entry. More... | |
Defines | |
#define | FAT_ATTRIB_READONLY |
The file is read-only. | |
#define | FAT_ATTRIB_HIDDEN |
The file is hidden. | |
#define | FAT_ATTRIB_SYSTEM |
The file is a system file. | |
#define | FAT_ATTRIB_VOLUME |
The file is empty and has the volume label as its name. | |
#define | FAT_ATTRIB_DIR |
The file is a directory. | |
#define | FAT_ATTRIB_ARCHIVE |
The file has to be archived. | |
#define | FAT_SEEK_SET |
The given offset is relative to the beginning of the file. | |
#define | FAT_SEEK_CUR |
The given offset is relative to the current read/write position. | |
#define | FAT_SEEK_END |
The given offset is relative to the end of the file. | |
Functions | |
struct fat_fs_struct * | fat_open (struct partition_struct *partition) |
Opens a FAT filesystem. | |
void | fat_close (struct fat_fs_struct *fs) |
Closes a FAT filesystem. | |
struct fat_file_struct * | fat_open_file (struct fat_fs_struct *fs, const struct fat_dir_entry_struct *dir_entry) |
Opens a file on a FAT filesystem. | |
void | fat_close_file (struct fat_file_struct *fd) |
Closes a file. | |
intptr_t | fat_read_file (struct fat_file_struct *fd, uint8_t *buffer, uintptr_t buffer_len) |
Reads data from a file. | |
intptr_t | fat_write_file (struct fat_file_struct *fd, const uint8_t *buffer, uintptr_t buffer_len) |
Writes data to a file. | |
uint8_t | fat_seek_file (struct fat_file_struct *fd, int32_t *offset, uint8_t whence) |
Repositions the read/write file offset. | |
uint8_t | fat_resize_file (struct fat_file_struct *fd, uint32_t size) |
Resizes a file to have a specific size. | |
struct fat_dir_struct * | fat_open_dir (struct fat_fs_struct *fs, const struct fat_dir_entry_struct *dir_entry) |
Opens a directory. | |
void | fat_close_dir (struct fat_dir_struct *dd) |
Closes a directory descriptor. | |
uint8_t | fat_read_dir (struct fat_dir_struct *dd, struct fat_dir_entry_struct *dir_entry) |
Reads the next directory entry contained within a parent directory. | |
uint8_t | fat_reset_dir (struct fat_dir_struct *dd) |
Resets a directory handle. | |
uint8_t | fat_create_file (struct fat_dir_struct *parent, const char *file, struct fat_dir_entry_struct *dir_entry) |
Creates a file. | |
uint8_t | fat_delete_file (struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry) |
Deletes a file or directory. | |
uint8_t | fat_move_file (struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry, struct fat_dir_struct *parent_new, const char *file_new) |
Moves or renames a file. | |
uint8_t | fat_create_dir (struct fat_dir_struct *parent, const char *dir, struct fat_dir_entry_struct *dir_entry) |
Creates a directory. | |
void | fat_get_file_modification_date (const struct fat_dir_entry_struct *dir_entry, uint16_t *year, uint8_t *month, uint8_t *day) |
Returns the modification date of a file. | |
void | fat_get_file_modification_time (const struct fat_dir_entry_struct *dir_entry, uint8_t *hour, uint8_t *min, uint8_t *sec) |
Returns the modification time of a file. | |
uint8_t | fat_get_dir_entry_of_path (struct fat_fs_struct *fs, const char *path, struct fat_dir_entry_struct *dir_entry) |
Retrieves the directory entry of a path. | |
offset_t | fat_get_fs_size (const struct fat_fs_struct *fs) |
Returns the amount of total storage capacity of the filesystem in bytes. | |
offset_t | fat_get_fs_free (const struct fat_fs_struct *fs) |
Returns the amount of free storage capacity on the filesystem in bytes. |
FAT header (license: GPLv2 or LGPLv2.1)