This is from my best recollection, so you'll have to bear with me. Is this Windows NT or Windows 95/98/ME?

If it's NT, then the behavior is somewhat sane, one writer and multiple readers of a file shouldn't be a problem. Beware of buffering and all that stuff.

I suspect from your "broken flock" statement that you're not using Windows NT. (Psst! flock() isn't broken, it's just not implemented on Win 95/98/ME, read on for why!)

With 95/98/ME it's a little different. When you open a file for writing, you've effectively locked everyone else out -- for writing, reading or whatever. That's the OS. This isn't Perl's fault. The flock() function doesn't work there, because it really doesn't need to.

The solution is, get a real OS. :)


In reply to Re: Opening a locked file for reading by clintp
in thread Opening a locked file for reading by entropy

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.