Yeah, it wasn't clear to me whether the original poster was being sloppy with terms like "child process" or with the term "fork".

This makes me wonder if emulated fork on Windows (native) Perl obeys $^F when duplicating interpreter instances for new threads. Seems like it doesn't, which is weird (to me). Update: Oh, right, $^F applies to exec, not to fork().

Sentences like "The files are temporary and I need to be able to delete them without another child locking them" make me think of using Win32API::File's createFile() to open the file w/o preventing the deleting (or renaming) of the file. You would likely follow that with OsFHandleOpen() which would cause Perl do duplicate the resulting Perl file handle when creating threads. My guess is that Perl's emulated fork() uses fdopen() to duplicate file handles and I suspect that such would not impose locking against delete/rename if such is missing from the original handle. But I've never checked either of those points.

Not that I'm claiming that such is the best solution, just adding information (and even more questions).

- tye        


In reply to Re^3: File handles with forked processes ("child") by tye
in thread File handles with forked processes by Anonymous 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.