compare last access date of a file in windows to current date



  • 1. Is it piped?
    Hi - From within a perl script, how can I deternine if STDxxx is from/to a pipe? Aloha => Beau;
  • 2. Reading formula from Excel sheet
    Hello there! Is there a way to read to read formula from MS Excel sheet without using OLE. I can use the OLE but annoying pop-ups for updating link while opening and saving the file while quitting keeps coming. I would appreciate any kind of solution. Thank you in advance.
  • 3. Run a block of sql commands using 'here document'
    Hi, I know that using 'Here Documents', we can output multiple lines. But is it possible to run a couple of commands? $s = qx [sqlplus user/paswd\@schema <<ENDOFSQL select 2 from DUAL; exit ENDOFSQL]; Any ideas on how to make the above code work?? (I do not want to install DBI module and then invoke the sql commands) Thanks in advance!!! Sailaja
  • 4. I can't write the apropriate content to the file.
    Hi everybody, I have a perl script, which can write some message to a new file, looks like the following. my $cmd="touch /data3/OGCserver-xu/htdocs/tmp/$time".".kml"; `$cmd`;#`touch ../../htdocs/tmp/xuhuanxiang.kml`; `chmod 777 /data3/OGCserver-xu/htdocs/tmp/$time.kml`; open (XHX,">","/data3/OGCserver-xu/htdocs/tmp/$time.kml") ; #print "Content-Type: application/\n\n"; print $kml; -------------------------------------------------------------------- 1 print XHX $kml;close XHX; -------------------------------------------------------------------2 The script does work well on a webpage, but it only write a part of the message to the file on another webpage. Can anybody help me? Best Regards, xu

compare last access date of a file in windows to current date

Postby mcmackey100602 » Wed, 05 May 2004 04:46:18 GMT

Hi all,

  I am new to perl and am working on in a Windows 2000 enviroment. I
have the need to compare the last access time of a file to the system
date and if it is greater that 2 weeks prior to the system date write
that file to a text file that will be used to archive the file.

  Any help would be appreciated.

Similar Threads:

1.Comparing file dates with current date

I am trying to compare a file's modified timestamp with the current date.
I can use 'stat' to get the timestamp of the file but am not sure how to compare it to the localtime(). More importantly I want to be able to quantify the difference in days, month, hours and minutes. 
Any suggestions?

2.URGENT HELP NEEDED--compare current date file with previous day

Hi All,

I am new in perl. I have report files which generate in particular
location day by day. I need to write a script to compare the current
date file with the previous day for first line. If there is a
difference it will generate email automatically to the users. The log
files with other few files generate in a folder which is named by date
(format: MM-DD-YY).

Some key points:

Location of the log files file:

/home/usr/09-26-06/log1.rpt and I need to compare with the previous
day: /home/usr/09-25-06/log1.rpt.... some thing like that.

The log.rpt file looks like:

PASS (P) 10
FAIL   (F)  1.............................

I need to compare the second line. If the no. of FAIL changes then it
will send email automatically to the users.

Any help is appreciated.


3.--compare current date file with previous day

4.How compare two dates or convert date to number

Perl neophyte here.

I have a record date in the format mm/dd/yyyy and I want to compare it to
another date in the same format. Is there a simple way to accomplish this
task? All I want to do is say 'if date1 <= date0' do or don't do
something. I've looked, but to no avail. Help please...

Thank you in advance,


5.Last "real" modification date of file

Bart Van der Donck < XXXX@XXXXX.COM > wrote:
>I am on FreeBSD.
>Is there a way to find out when file.txt was last changed ?
>I'm facing a situation when a file could legally be (re-)written with
>the same content. Don't ask me how I got there :-)

That depends upon if the file system (not the OS!) supports such a
And for legal matters also if there are any means to set that value


6. perldoc -q 'date|time' FAQ -- and -- making same change to *lots* of files, *without* date changed

7. file access dates

8. DBI, MS Access, inserting/updating a Access Date/Time value

Return to PERL


Who is online

Users browsing this forum: No registered users and 13 guest