Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Getting the correct ctime for a file on Windows 10by Veltro (Hermit) |
on Jul 05, 2018 at 20:24 UTC ( [id://1217997]=note: print w/replies, xml ) | Need Help?? |
Hello Peppe757, I've found another discussion regards this topic here. In this article there is an interesting link to Windows file times. So as it seems ctime does not give what you want. In the 'Windows file times' link the function GetFileTime is mentioned so looking for that I found the module Win32API::File::Time that has this function. So maybe you can try to use that one instead. edit: I found another module that I actually like better. The module is called Win32::UTCFileTime. I have created the following sample program for testing:
edit 2: Anonymous Monk asked: "But is it any different from built-in stat". The answer can be found in the documentation: Note that the 11th element of the 13-element list returned by stat() is the creation time on Win32, not the inode change time as it is on many other operating systems. Therefore, neither Perl's built-in utime() function nor this replacement function set that value to the current time as would happen on other operating systems.
In Section
Seekers of Perl Wisdom
|
|