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

Re: List who has a file open?

by maverick (Curate)
on Jan 25, 2002 at 04:35 UTC ( #141388=note: print w/replies, xml ) Need Help??


in reply to List who has a file open?

If you're on a Un*x try 'lsof'. From the man page it says it's on:
AIX 4.1.[45], 4.2[.1], and 4.3[.123] BSDI BSD/OS 2.1, 3.[01], and 4.[01] for Intel-based systems DC/OSx 1.1 for Pyramid systems DEC OSF/1, Digital UNIX, Tru64 UNIX 2.0, 3.2, 4.0, and 5.[01] FreeBSD 2.1.[67], 2.2[.x], 3.[012345], 4.[01], and 5.0 for Intel-based systems HP-UX 9.01, 10.20, and 11.00 Linux 2.0.3[2346] and 2.[1234].x for Intel-based systems NetBSD 1.[2345] for Alpha, Intel, and SPARC-based systems NEXTSTEP 3.[13] for NEXTSTEP architectures OpenBSD 2.[01234567] for Intel-based systems OpenStep 4.x Reliant UNIX 5.4[34] for Pyramid systems SCO OpenServer Release 3.0 and 5.0.[02456] for Intel-based systems SCO UnixWare 2.1.[123] and 7[[.0].1] for Intel-based systems Sequent PTX 2.1.9, 4.2.[13], 4.[34], 4.4[.1246], and 4.5[.1] for Seque +nt systems Solaris 2.5.1, 2.6, 7, 8 BETA, and 8 BETA-Refresh SunOS 4.1.x Ultrix 4.2
You could call it via:
open(LSOF,"/usr/sbin/lsof MY_OPTIONS_HERE |") || die $!; while(<LSOF>) { # so stuff }
or
@output = `/usr/sbin/lsof MY_OPTIONS_HERE`;
HTH

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://141388]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2018-06-21 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (118 votes). Check out past polls.

    Notices?