openscopeproject / ZipROFS

FUSE file system with transparent access to zip files as if they were folders.
MIT License
12 stars 5 forks source link

Show files inside zip with correct mtime/ctime #5

Closed JuniorJPDJ closed 4 years ago

JuniorJPDJ commented 4 years ago

ATM ZipROFS shows files inside ZIP with same ctime/mtime as ctime/mtime of ZIP file. ZIP file itself holds ctime of files inside ZIP which IMO should be used. I added this as TODO comment in #4, but forgot to do this: https://github.com/openscopeproject/ZipROFS/blob/1b05d8471ff8a6e4a0b4a364ef63b2104519ca60/ziprofs.py#L123 The question here is if we should to use it as ctime, mtime or both (I personaly would go with both).

qu1ck commented 4 years ago

I think we should only touch mtime. Otherwise more logic is needed to calculate direcotry mtime as max of ctime of files in it. If we keep all ctimes as zip file's ctime and only set mtime of files there will be no inconsistencies.

JuniorJPDJ commented 4 years ago

I'm not sure if every app will behave predictably with ctime > mtime - and that will be our case most of time.

qu1ck commented 4 years ago

It's normal for ctime to be after mtime. ctime is not creation time, it's metadata change time.

JuniorJPDJ commented 4 years ago

Oh. I was pretty sure it's creation time. It's good then, you are right :D I'm closing this, as you resolved issue.

JuniorJPDJ commented 4 years ago

BTW it seems like there's sometimes also time on directory inside zip: Screenshot_20200831_022237 I'm not sure what it depends on, but I wasn't doing any research, just noticed it when opening zips.

qu1ck commented 4 years ago

Zip file format does not support directory entries, only files. Some archivers put an empty . file for each subdirectory but it's not required.

JuniorJPDJ commented 4 years ago

That makes sense why one of zips have meta on directories and other doesn't. What do you think about supporting this . files in this case?

JuniorJPDJ commented 4 years ago

image It doesn't work. Look at date selected in terminal and date of the same dir in Ark window (selected one).

qu1ck commented 4 years ago

Your command prompt suggest you are 2 commits behind. Did you pull the changes?

JuniorJPDJ commented 4 years ago

..well I did.. On other PC.. Thanks, it works as intended >__<

qu1ck commented 4 years ago

If you feel like contributing more, I noticed a bug where returned timestamp is not in the right timezone. I.e. time in 7zip for me shows some hours ahead of what I see in ziprofs mounted folder. I didn't investigate this further, feel free to take a look.

JuniorJPDJ commented 4 years ago

We probably should open issue for that, so noone will forget about it :D I'm now doing other things, but maybe some day..