|
@ -34,7 +34,7 @@ int create_file_system(char* disk_name, char* hdd_or_partition, uint64_t filesys |
|
|
int lsfs_disk_create_entry(const char* path, Table_Entry_Kind entry_kind); |
|
|
int lsfs_disk_create_entry(const char* path, Table_Entry_Kind entry_kind); |
|
|
Directory_Table* lsfs_find_directory(const char* path, bool drop_filename); |
|
|
Directory_Table* lsfs_find_directory(const char* path, bool drop_filename); |
|
|
int lsfs_disk_getattr(lsfs_file* find_file, const char *path); |
|
|
int lsfs_disk_getattr(lsfs_file* find_file, const char *path); |
|
|
int lsfs_disk_delete_file(lsfs_file_id file_id); |
|
|
int lsfs_disk_delete_file(lsfs_file *file); |
|
|
int get_free_sectors_table(); |
|
|
int get_free_sectors_table(); |
|
|
int get_free_sectors(int num_sectors_needed, lsfs_sector_offset* output_array); |
|
|
int get_free_sectors(int num_sectors_needed, lsfs_sector_offset* output_array); |
|
|
int lsfs_disk_read_data_from_file(lsfs_file* file, int buffer_size, void* buffer_for_data); |
|
|
int lsfs_disk_read_data_from_file(lsfs_file* file, int buffer_size, void* buffer_for_data); |
|
@ -368,15 +368,12 @@ int lsfs_disk_rename_file(lsfs_file* file, const char* new_filename) { |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int lsfs_disk_delete_file(lsfs_file_id file_id) { |
|
|
int lsfs_disk_delete_file(lsfs_file *file) { |
|
|
mif* mif_record = calloc(1, SECTOR_SIZE); |
|
|
Table_Entry *zero_buffer = calloc(1, (DEFAULT_ENTRY_SIZE * SECTOR_SIZE)); |
|
|
read_data_from_disk(file_id, 1, mif_record); |
|
|
//read_data_from_disk(file_id, 1, mif_record);
|
|
|
|
|
|
write_data_to_disk(file->table_entry_sector_index, DEFAULT_TABLE_SIZE, zero_buffer); |
|
|
|
|
|
|
|
|
|
|
|
free(zero_buffer); |
|
|
// TODO Delete/free all data sectors.
|
|
|
|
|
|
// Delete/free the mif record sector.
|
|
|
|
|
|
|
|
|
|
|
|
free(mif_record); |
|
|
|
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|