Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserved modification timestamp does not preserve seconds #48

Open
wirawan0 opened this issue Dec 17, 2024 · 1 comment
Open

Preserved modification timestamp does not preserve seconds #48

wirawan0 opened this issue Dec 17, 2024 · 1 comment

Comments

@wirawan0
Copy link

wirawan0 commented Dec 17, 2024

Hi, I was surprised that better-adb-sync does not preserve the "second" part of the modification timestamp (a.k.a. mtime) when syncing files from Android to an external storage. Here is an example of the stat output on a file which was supposed to have mtime = 2022-03-07 12:21:13.504455586 -0500.

On a local Windows computer (NTFS partition):

$ stat VID-20191119-WA0005.mp4
  File: VID-20191119-WA0005.mp4
  Size: 19431           Blocks: 40         IO Block: 4096   regular file
Device: 842h/2114d      Inode: 89002726    Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/ wirawan)   Gid: ( 1000/ wirawan)
Access: 2022-06-13 00:22:06.832821569 -0400
Modify: 2022-03-07 12:21:00.000000000 -0500
Change: 2022-04-07 20:27:28.135417353 -0400
 Birth: -

On the Android device, the actual mtime was 2022-03-07 12:21:13.504455586 -0500 , and on an NTFS disk (the file was pulled from the Android phone into the disk using adb pull), the mtime became 2022-03-07 17:21:13.000000000 -0500.

I found from the source code snippet shown on bug #24 (#24) that this problem was apparently created "by design", since the timeformat string (for use with strftime) did not include the seconds. Could this be fixed? I'd rather have a timestamp accurate down to the second level; perhaps Windows/NTFS does not support more resolution than that.

@wirawan0
Copy link
Author

I think the best way to address this issue is to add rsync's --modify-window=NUM and emulate the behavior listed in rsync's manual page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant