Re^3: comparing 2 file time date stamps ( Path::Tiny File::stat Time::Piece )
by craigt (Acolyte) on Nov 04, 2014 at 13:00 UTC
|
anonymous_monk, I could not get that code to work. The Time-Piece was not available in the repositories PPM checked. I tried with File-Stat and got several PM dependency messages.
I apologize for not using these facilities as I should sometimes. My lack of experience is showing.
I tried reversing the file order in the diagnostics. The stat 9 values for both tests were still the values of the file not in the staging directory, in this case now the 2nd file in the diagnostic order. I don't seem to be able to see the file in the staging area.
| [reply] |
|
| [reply] |
|
I get the following error when I try to execute that subroutine
path" is not exported by the Path::Tiny module\nCan't continue after import
I use -
use File::stat;
use Path::Tiny qw/ path /;
use File::Spec;
| [reply] |
|
|
|
use File::stat;
use Time::localtime;
$dd[11] = ctime(stat("$xxfn1")->mtime);
$dd[12] = ctime(stat("$xxfn2")->mtime);
The result was for both files
Mon Nov 3 11:57:55 2014
which is the stamp of the file not in the staging directory.
All methods seem to return the same modification date for both files, even though the file dates are 11/3 and 11/2, respectively.
| [reply] [d/l] |
|
$ perl -e " use Time::Piece; print localtime->year,$/ "
2014
| [reply] [d/l] |
|
use File::stat;
use Time::localtime;
$dd[11] = ctime(stat("$xxfn1")->mtime);
$dd[12] = ctime(stat("$xxfn2")->mtime);
The result for both files was
Mon Nov 3 11:57:55 2014
which is the stamp of the file not in the staging directory.
All methods seem to return the same modification date for both files, even though the file dates are 11/3 and 11/2, respectively. | [reply] [d/l] |
|
printf "File 1:%s File 2: %s\n", $xxfn1, $xxfn2;
| [reply] [d/l] |
|
The correct files names are printed.
| [reply] |
|
| [reply] |
|
I'm working on an application on a Windows 7, Apache/2.0.64 (Win32), mod_perl/2.0.3, and Perl/v5.8.3 platform. This version of Perl has been rock solid, so I have not upgraded.
If I do need to upgrade Perl, what version should I go to. I've written about 110K lines and the application is up under mod_perl without error. This is a very important function I use in several ways in several places.
| [reply] |
|
Also, stat seems to get hosed in memory and no longer returns any file information. I have to reboot to get stat to work again.
| [reply] |
|
I just looked at the date of the file in the staging area in javascript with the same result. stat 9 is not being used in this pass. The file in the staging area keeps showing a Nov 3 date and the external date is Nov 2.
anonymous_monk, I don't see any way to respond as you requested. I'm sure its me. I only see an option to reply on the entry I've been using and those above on the page.
| [reply] |
|
Did you try removing the quotes around the file name variable? Run the following, verbatim, and post the results, verbatim. Where I have the ???, fill in the path and name of one of your files.
use strict;
use warnings;
use File::stat;
use Time::localtime;
my $file = ???;
printf "%s: %s\n", $file, ctime(stat($file)->mtime);
| [reply] [d/l] |
|
|
|