FAT implementation (license: GPLv2 or LGPLv2.1). More...
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. | |
cluster_t | fat_append_clusters (struct fat_fs_struct *fs, cluster_t cluster_num, cluster_t count) |
Appends a new cluster chain to an existing one. | |
uint8_t | fat_free_clusters (struct fat_fs_struct *fs, cluster_t cluster_num) |
Frees a cluster chain, or a part thereof. | |
uint8_t | fat_terminate_clusters (struct fat_fs_struct *fs, cluster_t cluster_num) |
Frees a part of a cluster chain and correctly terminates the rest. | |
uint8_t | fat_clear_cluster (const struct fat_fs_struct *fs, cluster_t cluster_num) |
Clears a single cluster. | |
uintptr_t | fat_clear_cluster_callback (uint8_t *buffer, offset_t offset, void *p) |
Callback function for clearing a cluster. | |
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. | |
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_calc_83_checksum (const uint8_t *file_name_83) |
Calculates the checksum for 8.3 names used within the corresponding lfn directory entries. | |
offset_t | fat_find_offset_for_dir_entry (struct fat_fs_struct *fs, const struct fat_dir_struct *parent, const struct fat_dir_entry_struct *dir_entry) |
Searches for space where to store a directory entry. | |
uint8_t | fat_write_dir_entry (const struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry) |
Writes a directory entry to disk. | |
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_create_dir (struct fat_dir_struct *parent, const char *dir, struct fat_dir_entry_struct *dir_entry) |
Creates a directory. | |
uint8_t | fat_delete_dir (struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry) |
Deletes 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. | |
void | fat_set_file_modification_date (struct fat_dir_entry_struct *dir_entry, uint16_t year, uint8_t month, uint8_t day) |
Sets the modification time of a date. | |
void | fat_set_file_modification_time (struct fat_dir_entry_struct *dir_entry, uint8_t hour, uint8_t min, uint8_t sec) |
Sets the modification time of a file. | |
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. | |
uint8_t | fat_get_fs_free_32_callback (uint8_t *buffer, offset_t offset, void *p) |
Callback function used for counting free clusters in a FAT32. |
FAT implementation (license: GPLv2 or LGPLv2.1).