<> wrote in comp.lang.perl.misc:
>
> Jürgen Exner wrote:
> > wrote:
> > > Jürgen Exner wrote:
> > >> wrote:
> > >>> I think that syntax would be like this (assuming you have the
> > >>> attachment name in the variable $attachment):
> > >>>
> > >>> if(-M $attachment <= 0.5) {
> > >
> > > This is a confusing file test. There is some documentation that says
> > > that -M is the age, others say that it is the modification date.
> > [lenghty test snipped]
> > > The test makes me think that the -M test returns the modification
> > > date.
> >
> > Problem is: different file systems keep track of different 'dates' and not
> > all dates (creation, modification, access, ...) are available on all file
> > systems.
> > Therefore you should be careful when using the results of -X as well as
> > stat() when dates are involved. Your code may be testing something different
> > on a different file system
>
> You may be right-but would perl have a file test that returns two
> unrelated statistics on different file systems? If a file system
> doesn't keep track of the modification date, would perl really return
> the age of the file?
It might. If a file system was to report the creation date where standard
file systems report the modification date, how is Perl to know?
Someone human would have to notice the discrepancy and write extra code
for the special case.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.