Skip to content

Preserved modification timestamp does not preserve seconds #48

@wirawan0

Description

@wirawan0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions