Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: comparing 2 file time date stamps

by Corion (Patriarch)
on Nov 06, 2014 at 14:26 UTC ( #1106378=note: print w/replies, xml ) Need Help??


in reply to Re^2: comparing 2 file time date stamps
in thread comparing 2 file time date stamps

Ah - if you specify the path names with backslashes instead of forward slashes, the Windows built-in tools will understand them from the command line:

my $file = "c:\\Steep\\USA Data\\State\\KY\\KY2.gif";

Replies are listed 'Best First'.
Re^4: comparing 2 file time date stamps
by craigt (Acolyte) on Nov 06, 2014 at 16:28 UTC
    It still barks at the space in the USA Data. I've tried several suggestions, as this is pretty common apparently, to no avail.

      Yes. If you have a space in the filename, you will need to quote the filename when passing it to dir, just like on the command line:

      system qq(dir "$file");
        Thanks for the help. Here is the result.
        Checking 'c:\Steep\USA Data\State\KY\KY2.gif'
         Volume in drive C is TI106426W0A
         Volume Serial Number is 00FF-BD6D
        
         Directory of c:\Steep\USA Data\State\KY
        
        11/05/2014  07:52 PM             1,687 KY2.gif
                       1 File(s)          1,687 bytes
                       0 Dir(s)  423,609,860,096 bytes free
        Mtime: 1415235120
        As string: Wed Nov  5 19:52:00 2014
        
        
        
        Checking 'c:\usr\www\steepusa\stage\KY\KY2.gif'
         Volume in drive C is TI106426W0A
         Volume Serial Number is 00FF-BD6D
        
         Directory of c:\usr\www\steepusa\stage\KY
        
        11/05/2014  07:52 PM             1,687 KY2.gif
                       1 File(s)          1,687 bytes
                       0 Dir(s)  423,609,860,096 bytes free
        Mtime: 1415235120
        As string: Wed Nov  5 19:52:00 2014
        
        The date of the 1st file is correct. The date on the 2nd file should be 11/4 at 5:03 instead of the same date as the 1st file. I've entered the twilight zone.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1106378]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2022-08-08 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?