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');"


In reply to Re: List who has a file open? by maverick
in thread List who has a file open? by Marza

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.