macos-fuse-t / fuse-t

Other
936 stars 7 forks source link

Original Date/Time is changed when Copy / View #17

Open TTT7275 opened 1 year ago

TTT7275 commented 1 year ago

Thanks for create this great module,

I have a problem with Original Date/Time is changed when Copy / Viewing. I created an issue in Cryptomator also -> https://github.com/cryptomator/cryptomator/issues/2700

Here is what I got :

When Copy

When Preview in Finder according to julesallen

macos-fuse-t commented 1 year ago

Unfortunately this is a bug of macOS that causes Preview to change file modification time (mtime) on an NFS volume

TTT7275 commented 1 year ago

Then, we can only wait and hope they will fix it.

Thank you for your quick reply.

julesallen commented 1 year ago

Hey Alex @macos-fuse-t , thank you for all the work you've put in on getting the project this far. kexts are a pia!

Unfortunately this is a bug of macOS that causes Preview to change file modification time (mtime) on an NFS volume

I'm not a filesystem developer and don't know where to dig to help get this fixed. You say it's a bug in macOS, is the core OS using an old or buggy version of NFS? Has this been reported to Apple and is the core of the NFS open source?

Looks like we're not alone here! https://apple.stackexchange.com/questions/452957/mac-quick-preview-change-file-datetime-in-nfs-shares

Happy to do some grunt work to help get this solved if you need the help.

macos-fuse-t commented 1 year ago

I will report this bug although I'm pretty sure it was already reported in the past Perhaps this is the culprit: nfs_vattr_set_bitmap() func: https://opensource.apple.com/source/xnu/xnu-7195.60.75/bsd/nfs/nfs4_subs.c.auto.html

macos-fuse-t commented 1 year ago

A workaround is available in 1.0.22

kapitainsky commented 1 year ago

It is great news that nomtime and noatime has been added!

For completeness could you also add nodiratime at some stage? It would solve the same problem for directories.

macos-fuse-t commented 1 year ago

nomtime and noatime apply both to files and folders

kapitainsky commented 1 year ago

I have just tested and it does not seem to be the case - here is some folder and file on FUSE-T share:

image

I copy it to other location on share drive (before mtime of file would also change - but this is now working)

image

I copy it to local disk:

image
macos-fuse-t commented 1 year ago

How did you test?

kapitainsky commented 1 year ago

Also some reference to other project findings when dealing with NFS on macOS

https://github.com/me-io/docker-machine-mac-nfs-mount/blob/master/README.md

kapitainsky commented 1 year ago

How did you test?

fuse-t with -o noatime and then I simply use finder copy/paste. This option made file mtime not to change anymore - which is great.

macos-fuse-t commented 1 year ago

You should use with -o nomtime. noatime is for access time

macos-fuse-t commented 1 year ago

Try with a libfuse sample fusexmp_fh which would mirror your hard disk.

kapitainsky commented 1 year ago

You should use with -o nomtime. noatime is for access time

Yes - but this is exactly what I want - to have mtime and prevent its changes by software like Finder trying to change atime.

Actually I think this is the most common case - people usually do not care about atime and want mtime to be accurate.

macos-fuse-t commented 1 year ago

Correct, that's why you should mount with "-o nomtime". It won't change modify time when hitting Preview. Access time would still get updated.

kapitainsky commented 1 year ago

Yes it wont change - ever:) I want to know when I edited my file... But yes I do understand that people might have different requirement so great we have both options available.

With -o noatime Finder and Preview are behaving like they should - not changing mtime - I guess because they can not modify atime no damage to mtime is done.

macos-fuse-t commented 9 months ago

Use experimental "-o backend=smb" which doesn't have this issue. I don't know what Mountain Duck is or how it works. See here https://github.com/macos-fuse-t/fuse-t/releases/tag/1.0.35