Created
July 17, 2011 15:34
-
-
Save xaicron/1087692 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Win32::Unicode::Native; | |
use Win32API::File::Time qw(GetFileTime SetFileTime); | |
my $file = "\x{2603}"; # unicode file name (snowman) | |
touch $file or die $! unless file_type f => $file; # create | |
say $file; | |
say "-" x 34 . '+' . '-' x 25; | |
say "Win32::Unicode::Native::stat | ", join ", ", (stat $file)[8, 9]; | |
say "Win32API::File::Time::GetFileTime | ", join ", ", GetFileTime($file); # not works | |
say "-" x 34 . '+' . '-' x 25; | |
say "Win32::Unicode::Native::utime | ", utime(time - 1000, time - 1000, $file); | |
say "Win32::Unicode::Native::stat | ", join ", ", (stat $file)[8, 9]; | |
say "Win32API::File::Time::SetFileTime | ", SetFileTime($file, time, time, time); # not works | |
say "Win32::Unicode::Native::stat | ", join ", ", (stat $file)[8, 9]; | |
say "-" x 34 . '+' . '-' x 25; | |
unlink $file or die $!; # cleanup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment