It might be possible to use (something like) chmod 0nnn, <path/*>; to set the files read-only--see your local man pages for the correct values of nnn to use--to whatever group/userid the process that is deleting them runs as, and then reset the permissions once you've processed them. However, that would probably mean that you would have to delete them in your code and could cause errors in the other process. You might also get away with creating a symbolic link (terminology?) to reference them (using a system utility?) that would keep data around until you deleted the link.

I'm really out of my knowledge base on *nix, assuming that is your OS, so take this with a big pinch of salt, but the ideas may be useful.

UpdateAnd didn't I prove it! I completely missed any association between the PROC arg to readdir and anything to do with the system process list. D'oh!


Examine what is said, not who speaks.

The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.


In reply to Re: fastest way to open a file and stroing it? by BrowserUk
in thread fastest way to open a file and storing it? by snam

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.