Thank you for the help, all. You've made me realize how little I actually remember of the signal handling portion of Unix.

sauoq - Your initial comment was one of the theories I had, but didn't make any sense since either it should have been already created (since after the signal handler's done killing it, the file is indeed there), or not created at all. Do you know what might cause that behavior?

aristotle, your handler makes sense on a couple of levels - particularly, I'll only be actually doing cleanup in a location where I have control of the code, so I don't have to wonder at the behavior of LWP. Additionally, I was trying to remove the file, then letting it finish downloading (forgot to exit), none too bright. Even after that change, though, the signal handler's not removing the file - claims it doesn't exist yet, and yet there it is after the program terminates.

So I'll just use your idea and tell it to clean up afterwards if it gets SIGINTed.

fokat and wtp, thanks for the correct forking method - IIRC, my systems programming teacher had the (poor, but amusing) attitude that if the program's having fork problems, there's probably something worse wrong with the system anyway.

JSchmitz - I have looked at the Sun tools every once in a while. I admit it's been six months or more since I have, and perhaps they've gotten better. I should try them again and see whether they'll save me the work. As I said, though, this problem's almost as much for the experience as for the end product ;-)

Thanks, all!


In reply to Re: $SIG{INT} unlink problem by Ferret
in thread $SIG{INT} unlink problem by Ferret

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.