Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions diskfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

diskfile_entry diskfile_entries[DISKFILE_MAX_ENTRIES];
size_t diskfile_entries_count = 0;
time_t diskfile_time;

static off_t
diskfile_source_size(const char *path) {
Expand Down Expand Up @@ -44,6 +45,9 @@ diskfile_getattr(const char *path, struct stat *stbuf) {
if (entry->size == -1)
entry->size = diskfile_source_size(entry->source);
stbuf->st_size = entry->size;
stbuf->st_ctime = diskfile_time;
stbuf->st_mtime = diskfile_time;
stbuf->st_atime = diskfile_time;
return 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions diskfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ typedef struct {
} diskfile_entry;
extern diskfile_entry diskfile_entries[];
extern size_t diskfile_entries_count;
extern time_t diskfile_time;

extern struct fuse_operations diskfile_operations;
off_t diskfile_device_size(const char *path);
2 changes: 2 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ int main(int argc, char* argv[]) {
// put the mountpoint back
fuse_opt_add_arg(&args, diskfile_entries[--diskfile_entries_count].source);

diskfile_time = time(NULL);

return fuse_main(args.argc, args.argv, &diskfile_operations, NULL);
}