in reply to file timestamp and Windows 7

This works fine on Windows XP but not on Windows 7 (I use Win32::UTCFileTime too).

How does it fail, whats the error message?

Is something special needed for Windows 7 or is this not supported?

perlport says
utime
Only the modification time is updated. (BeOS, VMS, RISC OS)

May not behave as expected. Behavior depends on the C runtime library's implementation of utime(), and the filesystem being used. The FAT filesystem typically does not support an "access time" field, and it may limit timestamps to a granularity of two seconds. (Win32)

An examination of the source reveals, just like perlport says, behaviour depends on the c runtimes utime, so I expect it to work much like microsoft says it should :)

Replies are listed 'Best First'.
Re^2: file timestamp and Windows 7
by momo33 (Beadle) on Jan 05, 2011 at 08:03 UTC
    Sorry, my mistake: On Windows 7 the file timestamp is not updated as it is updated on Windows XP.
      Sorry, my mistake: On Windows 7 the file timestamp is not updated as it is updated on Windows XP.

      When it fails to update the timestamp, it should set errno, so what is errno set to?

      utime(time, time, $file) or die sprintf "ERRRR(%d)(%s)(%d)(%s)", $!,$!,$^E,$^E;
        A mystery: with the die-error it works fine, without it does not. Maybe a weird bug somewhere. Thank you both!