Dear brethren in Perl,

What would a perl hacker do to determine if a file is currently being written to?

I am looking for guidance on behalf of a collegue. He needs help debugging a beta release of an FTP server on a whacky unix machine. For some reason yet unknown to us, the Unix (Solaris 9) isn't allowing the FTP server to run the fuser() command on its own files - alas, we aren't system administrators there. (The FTP daemon is running as a non-privileged user)
fuser() is what different instances of the FTP daemon would do to determine, if a file was eligible to be moved, overwritten etc.

The lsof() command would also have been nice, yet it isn't installed on that machine.
flock would have been very nice, but it must run on a shared file system.

And that's all I've come up with at the moment. Got any more ideas to share?

Cheers, Sören

2004-10-22 Edited by Arunbear: Changed title from 'Is anybody using that file, tell me?', as per Monastery guidelines


In reply to (OT) Is anybody using that file, tell me? by Happy-the-monk

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.