|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
How do I retrieve last modified attribute of some file in perl?
And in what format will that number be? |
|
#2
|
|||
|
|||
|
>>How do I retrieve last modified attribute of some file in perl?
#!/usr/local/bin/perl $file = "/system/path/to/file"; print "Content-type: text/htmlnn"; $ls= `ls -ATl $file`; @fields = split(/s+/, $ls); print "$fields[7] $fields[5] $fields[6], $fields[8]"; >>And in what format will that number be? 10:23:02 Jul 9, 2000 or rotate the $fields[x] to whatever format you like To retrieve the lat modified time of the file (i.e. hello.html) itself, simply do the following: #hello.html <html> <body> <!--#echo var="LAST_MODIFIED"--> </body> </html> The format is: Sunday, 09-Jul-2000 10:23:02 PDT |
|
#3
|
|||
|
|||
|
Nice.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > last modified? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|