Linux/Unix you would use.

eg:
fuser -c /tmp
or
lsof could also be used.


I was wondering if there was a perl module that does the same thing.



________________________________
 From: David Precious <dav...@preshweb.co.uk>
To: beginners@perl.org 
Cc: Paul.G <medur...@yahoo.com.au> 
Sent: Thursday, 10 January 2013 8:22 PM
Subject: Re: check processes accessing file system
 
On Wed, 9 Jan 2013 17:45:51 -0800 (PST)
"Paul.G" <medur...@yahoo.com.au> wrote:

> Is there a quck way to test if processes are accessing file system in
> perl?

That's quite a vague requirement.

Find out what processes have a specific file open?

Find out what processes are doing IO at that specific moment?

What is it you actually need to find out?

How you do this may be somewhat OS-specific too, and you haven't
mentioned what OS you're using.

If you're using a Unixy system and want to know what processes have a
specific file open, take a look at Unix::Lsof - e.g.:

  use Unix::Lsof;
  my ($output,$error) = Unix::Lsof::lsof("afile.txt");
  my @pids = keys %$output;

(Checking for error is left as an exercise to the reader.)



-- 
David Precious ("bigpresh") <dav...@preshweb.co.uk>
http://www.preshweb.co.uk/     www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin    www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan        www.preshweb.co.uk/github



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Reply via email to