relan / exfat

Free exFAT file system implementation
GNU General Public License v2.0
795 stars 182 forks source link

Add support for timezone offsets #119

Closed nhunsperger closed 5 years ago

nhunsperger commented 5 years ago

Fixes #70. The timezone offset field is used, if present, to convert the stored local timestamp to the current timezone on read. The current timezone is set into the offset field when updating a timestamp.

To validate this change, I created files in many different timezones on an exFAT image. I was sure to include TZs that fall on 15 minute offsets. I also accounted for the necessary unmount/mount when changing timezones with fuse-exfat. The systems used to create the files were:

I then generated a dir listing of the exFAT image as read by all 4 systems. In summary:

I feel that the last point is acceptable. The point of using exFAT is for OS interoperability, and this patch improves upon that. Additionally, any user with both unpatched and patched systems will see no difference as long as both systems are in the same timezone.

Full listing results: fuse-exfat-1.3.0-patched-read.txt fuse-exfat-1.3.0-read.txt osx-read.txt windows-read.txt

Additionally, I performed a check of all 3 timestamps (mtime, atime, and crtime) to validate that they are all updated correctly. This was done by creating, editing, and accessing files under different timezones.

relan commented 5 years ago

Windows is the reference exFAT implementation, so everything you wrote is correct.

Thanks a lot!