Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

File Test -A problem on SunOS 5.9 & perl 5.8.3

by zakzebrowski (Curate)
on May 25, 2004 at 13:33 UTC ( #356199=perlquestion: print w/replies, xml ) Need Help??

zakzebrowski has asked for the wisdom of the Perl Monks concerning the following question:

All,

I've run into a strange file test problem. When I do a -A on a file, the return value is 0.0000 for the age of the file. That would be fine if the file was open and in use, but it's not in use, according to the command lsof. The uname -r -s returns SunOS 5.9 and Perl -V returns 5.8.3. The code worked fine on SunOS 5.8 under perl 5.6.1. Any ideas? BTW, -C and -M return resonable values... (Google and perlmonks (as far as I searched) returned no meaningfull results.)

UPDATE: It appears to be localized to the operating system, and is not a perl bug, special thanks to dave_the_m for localizing the problem!
Cheers,


----
Zak - the office

Replies are listed 'Best First'.
Re: File Test -A problem on SunOS 5.9 & perl 5.8.3
by dave_the_m (Monsignor) on May 25, 2004 at 13:41 UTC
    add a system("ls -u /the/file") to your code directly after the -A and see what the OS thinks the last accessed time was.
      This doesn't work. Ideas? Output:
      bash-2.05$ls -u /tmp/file.dat file.dat bash-2.05$ls -u /tmp/somedir bash-2.05$


      ----
      Zak - the office
        Sorry, that should be ls -lu

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://356199]
Approved by calin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2020-07-14 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?