in reply to Maintaining date modified timestamp when copying files
Windows timestamps
Quoting myself from Re: Change create file date:
A quick search on CPAN reveals that Win32API::File::Time may be able to help you. From its synopsis:
use Win32API::File::Time qw{:win}; ($atime, $mtime, $ctime) = GetFileTime ($filename); SetFileTime ($filename, $atime, $mtime, $ctime);
(Unfortunately still untested.)
Update:
the timestamps, at the moment, are one of the key ways that I’m keeping track of the large amount of data I’ve got
Actually, as you're discovering yourself, this is dangerous, I'd strongly recommend you don't rely on the filesystem to keep track of that information, at the very least store the date/time information in a separate simple text file. Update 2: The following will take the list of files in the current directory (excluding those beginning with a dot) and output a tab-separated list of filename, ctime, mtime, and atime (if available). You can change the glob expression "*" to match specific files if you like.
perl -MFile::Glob=bsd_glob -le '$,=qq(\t);print$_,(stat)[10,9,8]for bs +d_glob(q(*))'
(You may need to change the quotes, I'm not on Windows at the moment.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Maintaining date modified timestamp when copying files (updated x2)
by Maire (Scribe) on Oct 31, 2017 at 09:16 UTC |