Skip Menu |
Report information
Id: 128506
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: sftf-misc [at] mail.ru
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: File's ctime differ in perl5 and perl6
Download (untitled) / with headers
text/plain 2.3k
OS: Windows Server 2012 R2 Standard FS: NTFS TZ: +06:00 === perl5 e:\temporary>perl -v This is perl 5, version 22, subversion 0 (v5.22.0) built for MSWin32-x64-multi-thread e:\temporary>type ctime.pl use File::stat; use Time::Piece; my $fn1 = 't:\temporary\tia\Энергия\print.pdf'; my $fn2 = 't:\temporary\tia\Энергия\kl_to_1c.txt'; for ($fn1,$fn2) { my $fs = stat($_); print "$_\n"; print 'changed ',gmtime($fs->ctime)->datetime,"\n"; print 'modified ',gmtime($fs->mtime)->datetime,"\n"; print 'accessed ',gmtime($fs->atime)->datetime,"\n"; } e:\temporary>perl ctime.pl t:\temporary\tia\Энергия\print.pdf changed 2016-06-30T03:50:54 <== (1) modified 2016-05-04T03:03:08 accessed 2016-06-30T03:50:54 t:\temporary\tia\Энергия\kl_to_1c.txt changed 2016-06-30T03:50:54 <== (3) modified 2016-06-30T03:12:35 accessed 2016-06-30T03:50:54 === perl6 e:\temporary>perl6 -v This is Rakudo version 2016.04 built on MoarVM version 2016.04 implementing Perl 6.c. e:\temporary>type ctime.pl6 use v6; my $fio1 = 't:\temporary\tia\Энергия\print.pdf'.IO; my $fio2 = 't:\temporary\tia\Энергия\kl_to_1c.txt'.IO; for $fio1,$fio2 { say .path; say 'changed ', .changed.DateTime.truncated-to('second'); say 'modified ', .modified.DateTime.truncated-to('second'); say 'accessed ', .accessed.DateTime.truncated-to('second'); } e:\temporary>perl6 ctime.pl6 t:\temporary\tia\Энергия\print.pdf changed 2016-05-04T03:03:08Z <== (2) modified 2016-05-04T03:03:08Z accessed 2016-06-30T03:50:54Z t:\temporary\tia\Энергия\kl_to_1c.txt changed 2016-06-30T04:10:08Z <== (4) modified 2016-06-30T03:12:35Z accessed 2016-06-30T03:50:54Z (1) and (3) is what Windows show in file properties as 'Created'. (1),(2) and (3),(4) are different. Reproducing (1),(2). 1) Create file with text editor. Difference will be in seconds. From perl5: changed 2016-06-30T16:38:42 modified 2016-06-30T16:38:48 accessed 2016-06-30T16:38:42 From perl6: changed 2016-06-30T16:38:48Z modified 2016-06-30T16:38:48Z accessed 2016-06-30T16:38:42Z 2) Edit this file several minutes later. Difference will be more noticeable. From perl5: changed 2016-06-30T16:38:42 <== modified 2016-06-30T16:49:17 accessed 2016-06-30T16:38:42 From perl6: changed 2016-06-30T16:49:17Z <== modified 2016-06-30T16:49:17Z accessed 2016-06-30T16:38:42Z
Download (untitled) / with headers
text/plain 1.2k
CygWin Show quoted text
>stat --v
stat (GNU coreutils) 8.23 Packaged by Cygwin (8.23-4) Show quoted text
>stat print2.pdf
File: ‘print2.pdf’ Size: 9 Blocks: 1 IO Block: 65536 regular file Device: 58a40fd3h/1487146963d Inode: 844424930137032 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 500/Administrator) Gid: ( 513/Domain Users) Access: 2016-10-01 22:38:14.422316300 +0600 Modify: 2016-06-30 22:49:17.215269700 +0600 Change: 2016-10-01 22:33:28.579119600 +0600 Birth: 2016-06-30 22:38:42.435453200 +0600 Show quoted text
>perl -v
This is perl 5, version 14, subversion 4 (v5.14.4) built for cygwin-thread-multi-64int Show quoted text
>perl ctime2.pl
.\print2.pdf changed 2016-10-01T22:33:28 # == stat 'Change' modified 2016-06-30T22:49:17 # == stat 'Modify' accessed 2016-10-01T22:38:14 # == stat 'Access' Win32 This is perl 5, version 22, subversion 0 (v5.22.0) built for MSWin32-x64-multi-thread Show quoted text
>perl ctime2.pl
.\print2.pdf changed 2016-06-30T22:38:42 # == stat 'Birth' modified 2016-06-30T22:49:17 # == stat 'Modify' accessed 2016-10-01T22:37:42 # == ??? Show quoted text
>perl6 ctime2.pl6
This is Rakudo version 2016.07.1 built on MoarVM version 2016.0 implementing Perl 6.c. Show quoted text
>perl6 ctime2.pl6
./print2.pdf changed 2016-10-01T16:33:28Z # == stat 'Change' modified 2016-06-30T16:49:17Z # == stat 'Modify' accessed 2016-10-01T16:38:14Z # == stat 'Access'
Download (untitled) / with headers
text/plain 1.1k
Another shot. Show quoted text
ctime>stat --v
stat (GNU coreutils) 8.23 Packaged by Cygwin (8.23-4) Show quoted text
ctime>stat t:/temporary/tia/Энергия/print.pdf
File: ‘t:/temporary/tia/Энергия/print.pdf’ Size: 66288 Blocks: 68 IO Block: 65536 regular file Device: dfe235h/14672437d Inode: 56294995342131413 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 500/Administrator) Gid: ( 513/Domain Users) Access: 2016-10-03 10:50:16.791413100 +0600 Modify: 2016-08-22 09:08:07.671978500 +0600 Change: 2016-08-22 09:08:07.671978500 +0600 Birth: 2016-10-03 10:50:16.791413100 +0600 # All 'stat' times are OK. Show quoted text
ctime>perl -v
This is perl 5, version 22, subversion 0 (v5.22.0) built for MSWin32-x64-multi-thread Show quoted text
ctime>perl ctime.pl
t:\temporary\tia\Энергия\print.pdf changed 2016-10-03T10:50:16 # != stat 'Change' modified 2016-08-22T09:08:07 # OK accessed 2016-10-03T10:50:16 # OK Show quoted text
ctime>perl6 ctime2.pl6
This is Rakudo version 2016.07.1 built on MoarVM version 2016.0 implementing Perl 6.c. Show quoted text
ctime>perl6 ctime.pl6
t:\temporary\tia\Энергия\print.pdf changed 2016-08-22T09:08:07Z # OK modified 2016-08-22T09:08:07Z # OK accessed 2016-10-03T10:50:16Z # OK


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org