You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you seeing the same behavior in lxfs (e.g. root directory) or just in drvfs? IIRC, we recently found an issue with drvfs timestamps but I'll double check.
I'm seeing the issue only when copying files within the windows filesystem; cp -p works as expected within my home directory of the bash shell, and also when copying a file form the windows filesystem into my home directory.
This is due to the way that Windows updates timestamps, which it only does when the handle closes. When you use "cp -p" it opens the target file, writes to it, sets the timestamp, then closes it. Setting the timestamp doesn't use the same handle due to our VFS design, so when the file is closed Windows updates the timestamp again because that handle was written to.
John Starks (@jstarks) I'm seeing this bug in the WSL(2) in Windows 10, however the issue is that while the seconds part of the timestamp is preserved, the milliseconds part is zeroed out in the destination file.
Activity
stehufntdev commentedon Apr 18, 2017
Are you seeing the same behavior in lxfs (e.g. root directory) or just in drvfs? IIRC, we recently found an issue with drvfs timestamps but I'll double check.
cmendl commentedon Apr 18, 2017
I'm seeing the issue only when copying files within the windows filesystem; cp -p works as expected within my home directory of the bash shell, and also when copying a file form the windows filesystem into my home directory.
Chris
SvenGroot commentedon Apr 18, 2017
This is due to the way that Windows updates timestamps, which it only does when the handle closes. When you use "cp -p" it opens the target file, writes to it, sets the timestamp, then closes it. Setting the timestamp doesn't use the same handle due to our VFS design, so when the file is closed Windows updates the timestamp again because that handle was written to.
We're working on ways to mitigate this issue.
sunjoong commentedon Apr 28, 2017
Sven Groot (@SvenGroot) - Because
makeis a timestamp based utility, it would make problems. I hope it will be fixed soon.jstarks commentedon Dec 19, 2017
This should be fixed in insider build 17063.
michael-ts commentedon Sep 13, 2022
John Starks (@jstarks) I'm seeing this bug in the WSL(2) in Windows 10, however the issue is that while the seconds part of the timestamp is preserved, the milliseconds part is zeroed out in the destination file.