Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: File Test

by AgentM (Curate)
on Apr 05, 2001 at 21:36 UTC ( #70177=note: print w/ replies, xml ) Need Help??


in reply to File Test

Under UN*X? No. The big function would be making queries to either the FS or the kernel, depending on the OS.

Under MacOS? No problem. See Mac::MoreFiles. A function already exists to do that. (MacOS supports mandatoy file locking.)

Under AFS (AtheOS)? Node watching is supported and encouraged (cool stuff).

Under NFS? Too much chance for race conditions- no way.

Under VMS? I don't know.

Under Win32? I don't care.

If you come a across a situation where you need to know if a file is currently being used without some form of IPC, you're in bad shape- this is indicative of a poor design.

AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.


Comment on Re: File Test
Re: Re: File Test
by Anonymous Monk on Apr 05, 2001 at 22:58 UTC
    Under UNIX, you could parse the output of the lsof program (if available).
      What happens when someone else starts reading the file while you are parsing lsof's output? Or stops reading it, for that matter.

      --
      $you = new YOU;
      honk() if $you->love(perl)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2014-07-28 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (210 votes), past polls