-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Version
Microsoft Windows [Version 10.0.22000.258]
WSL Version
- WSL 2
- WSL 1
Kernel Version
5.10.60.1
Distro Version
Debian 11.0
Other Software
'touch' utility from the Debian distro's Coreutils package (version 8.32).
Repro Steps
Assume the current user is named fred. All steps are performed in the directory C:\Users\fred\Documents.
Reason for the choice of directory: it is in an NTFS partition which supports a timestamp resolution of 10^-7 seconds.
Steps to follow:
- Launch Debian Linux and get a bash prompt.
- Enter
cd /mnt/c/Users/fred/Documents. - Enter
touch newfileto create a new file. - Enter
stat newfileto get the timestamps of the new file. Here is a sample output:
File: newfile
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 41h/65d Inode: 3659174697380631 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1000/ wiser) Gid: ( 1000/ wiser)
Access: 2021-10-21 13:18:53.270571800 +0800
Modify: 2021-10-21 13:18:53.270571800 +0800
Change: 2021-10-21 13:18:53.270571800 +0800
Birth: -
- Using this file as a reference file, create another by entering
touch anothernewfile -r newfile. - Get its timestamps via
stat anothernewfile. Here is a sample output:
File: anothernewfile
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 41h/65d Inode: 4785074604233393 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1000/ wiser) Gid: ( 1000/ wiser)
Access: 2021-10-21 13:18:53.000000000 +0800
Modify: 2021-10-21 13:18:53.000000000 +0800
Change: 2021-10-21 13:23:15.413922200 +0800
Birth: -
Expected Behavior
Both stat commands should output timestamps in a resolution of 10^-7 second.
Actual Behavior
The second stat command shows that the second touch command truncate the 'Access' and 'Modify' timestamps to the nearest second.
Diagnostic Logs
No response
Reactions are currently unavailable