[EMAIL PROTECTED] wrote:
> Hi there mates,
> 
>    I would like to Know If anyone of you have already tried to get
> the time and date a file was created from the OS. 

The stat() function will do that. But read on...

> For example imagine
> I have a *.java file and I would like to compare the *.class file
> date of creation with the date of edition of the *.java file in other
> to make sure the *.class file was generated (compiled ) or not after
> the *.java new edition. 

If you just want to compare two files to see if one is newer, use the -M
operator:

   $need_recompile = 1 if -M 'foo.java' < -M 'foo.class';

-M gives you the age in days of a file, measured from the time your script
was started (stored in the special $^T variable). The specific value
returned from -M isn't important in this case, but two -M returns can be
compared to see which file is newer.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to