The following features are supported:
Files | |
file | fat16.c |
FAT16 implementation. | |
file | fat16.h |
FAT16 header. | |
file | fat16_config.h |
FAT16 configuration. | |
Modules | |
FAT16 configuration | |
Preprocessor defines to configure the FAT16 implementation. | |
FAT16 access | |
Basic functions for handling a FAT16 filesystem. | |
FAT16 file functions | |
Functions for managing files. | |
FAT16 directory functions | |
Functions for managing directories. | |
Data Structures | |
struct | fat16_dir_entry_struct |
Describes a directory entry. More... | |
Functions | |
fat16_fs_struct * | fat16_open (struct partition_struct *partition) |
Opens a FAT16 filesystem. | |
void | fat16_close (struct fat16_fs_struct *fs) |
Closes a FAT16 filesystem. | |
fat16_file_struct * | fat16_open_file (struct fat16_fs_struct *fs, const struct fat16_dir_entry_struct *dir_entry) |
Opens a file on a FAT16 filesystem. | |
void | fat16_close_file (struct fat16_file_struct *fd) |
Closes a file. | |
int16_t | fat16_read_file (struct fat16_file_struct *fd, uint8_t *buffer, uint16_t buffer_len) |
Reads data from a file. | |
int16_t | fat16_write_file (struct fat16_file_struct *fd, const uint8_t *buffer, uint16_t buffer_len) |
Writes data to a file. | |
uint8_t | fat16_seek_file (struct fat16_file_struct *fd, int32_t *offset, uint8_t whence) |
Repositions the read/write file offset. | |
uint8_t | fat16_resize_file (struct fat16_file_struct *fd, uint32_t size) |
Resizes a file to have a specific size. | |
fat16_dir_struct * | fat16_open_dir (struct fat16_fs_struct *fs, const struct fat16_dir_entry_struct *dir_entry) |
Opens a directory. | |
void | fat16_close_dir (struct fat16_dir_struct *dd) |
Closes a directory descriptor. | |
uint8_t | fat16_read_dir (struct fat16_dir_struct *dd, struct fat16_dir_entry_struct *dir_entry) |
Reads the next directory entry contained within a parent directory. | |
uint8_t | fat16_reset_dir (struct fat16_dir_struct *dd) |
Resets a directory handle. | |
uint8_t | fat16_create_file (struct fat16_dir_struct *parent, const char *file, struct fat16_dir_entry_struct *dir_entry) |
Creates a file. | |
uint8_t | fat16_delete_file (struct fat16_fs_struct *fs, struct fat16_dir_entry_struct *dir_entry) |
Deletes a file or directory. | |
uint8_t | fat16_get_dir_entry_of_path (struct fat16_fs_struct *fs, const char *path, struct fat16_dir_entry_struct *dir_entry) |
Retrieves the directory entry of a path. |
|
Closes a FAT16 filesystem. When this function returns, the given filesystem descriptor will be invalid.
|
|
Closes a directory descriptor. This function destroys a directory descriptor which was previously obtained by calling fat16_open_dir(). When this function returns, the given descriptor will be invalid.
|
|
Closes a file.
|
|
Creates a file. Creates a file and obtains the directory entry of the new file. If the file to create already exists, the directory entry of the existing file will be returned within the dir_entry parameter.
|
|
Deletes a file or directory. It is not checked if the file to delete is a directory. If a directory is deleted without first deleting its subdirectories and files, disk space occupied by these files will get wasted as there is no chance to release it and mark it as free.
|
|
Retrieves the directory entry of a path. The given path may both describe a file or a directory.
|
|
Opens a FAT16 filesystem.
|
|
Opens a directory.
|
|
Opens a file on a FAT16 filesystem.
|
|
Reads the next directory entry contained within a parent directory.
|
|
Reads data from a file. The data requested is read from the current file location.
|
|
Resets a directory handle. Resets the directory handle such that reading restarts with the first directory entry.
|
|
Resizes a file to have a specific size. Enlarges or shrinks the file pointed to by the file descriptor to have exactly the specified size. If the file is truncated, all bytes having an equal or larger offset than the given size are lost. If the file is expanded, the additional bytes are allocated, but they keep their values.
|
|
Repositions the read/write file offset. Changes the file offset where the next call to fat16_read_file() or fat16_write_file() starts reading/writing. If the new offset is beyond the end of the file, fat16_resize_file() is implicitly called, i.e. the file is expanded.
The new offset can be given in different ways determined by the
The resulting absolute offset is written to the location the
|
|
Writes data to a file. The data is written to the current file location.
|