ops: add the ability to write and delete files
Right now it only works on the root directory, and has much more functionality that needs adding. But it passes the tests. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
@ -18,6 +18,8 @@ struct fat12_partition * fat12_alloc(void);
|
||||
int fat12_open(struct fat12_partition *part, const char *filename);
|
||||
int fat12_close(struct fat12_partition *part);
|
||||
void fat12_free(struct fat12_partition **part);
|
||||
void fat12_sync(struct fat12_partition *part);
|
||||
void fat12_flush(struct fat12_partition *part);
|
||||
|
||||
int fat12_ls_foreach(struct fat12_partition *part, uint32_t dir_cluster, void *data, int (*callback)(void *data, const struct fat12_dirent *dirent));
|
||||
|
||||
@ -30,6 +32,9 @@ uint32_t fat12_read_u32(void *ptr);
|
||||
void fat12_set_cluster(void *fat, uint32_t cluster, uint32_t value);
|
||||
uint32_t fat12_get_cluster(void *fat, uint32_t cluster);
|
||||
|
||||
int fat12_write_file(struct fat12_partition *part, const char *filename, const void *bfr, uint32_t size);
|
||||
int fat12_delete_file(struct fat12_partition *part, const char *filename);
|
||||
|
||||
int fat12_defrag(struct pang_io *io);
|
||||
int fat12_mkfs(struct pang_io *io, uint32_t bytes);
|
||||
|
||||
|
Reference in New Issue
Block a user