|
|
@ -59,7 +59,11 @@ int lsfs_rmdir(const char *path) { |
|
|
|
|
|
|
|
int lsfs_unlink(const char *path) { |
|
|
|
|
|
|
|
// remove / delete a file
|
|
|
|
lsfs_file *found_file = calloc(1, sizeof(lsfs_file)); |
|
|
|
|
|
|
|
lsfs_disk_getattr(found_file, path); |
|
|
|
lsfs_disk_delete_file(found_file); |
|
|
|
free(found_file); |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
@ -126,21 +130,13 @@ int lsfs_getattr( const char *path, struct stat *stbuf ) { |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
int lsfs_write(const char *path, const char *content, size_t content_length, off_t offset_to_next_entry, struct fuse_file_info *file_info) { |
|
|
|
//(void) offset_to_next_entry;
|
|
|
|
//(void) file_info;
|
|
|
|
int res; |
|
|
|
//printf("WRITE: offset id: %d\n", offset_to_next_entry);
|
|
|
|
// printf("read: (path=%s)\n", path);
|
|
|
|
|
|
|
|
//time_t current_time;
|
|
|
|
//time ( ¤t_time );
|
|
|
|
|
|
|
|
res = lsfs_disk_write_data_to_file(((lsfs_file*) file_info->fh), content_length, (void*) content, offset_to_next_entry); |
|
|
|
int lsfs_write(const char *path, const char *content, size_t content_length, off_t offset_to_next_entry, struct fuse_file_info *file_info) |
|
|
|
{ |
|
|
|
int res = lsfs_disk_write_data_to_file( |
|
|
|
((lsfs_file*) file_info->fh), |
|
|
|
content_length, |
|
|
|
(void*) content, offset_to_next_entry); |
|
|
|
|
|
|
|
//((lsfs_file*) file_info->fh)->size += res;
|
|
|
|
//((lsfs_file*) file_info->fh)->access_time = current_time;
|
|
|
|
//((lsfs_file*) file_info->fh)->modification_time = current_time;
|
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|