roboticus, no, the "Invalid cross-device link" error is caught by File::Copy::move() and causes it to try to copy the file and then unlink.

runrig, no, "trying to delete the file while it is still being written to" is not in evidence in the traces provided. The trace shows the destination being unlinked (despite it never having been created) after the source could not be opened.

As the original poster correctly noted, the problem is:

open("/mnt­/xfer/3165­0_WRETCHED Radio 04-25_DIST­.wav", O_RDONLY|O­_L +ARGEFILE­) = -1 ETXTBSY (Text file busy

So the addition of $! will likely add "Text file busy" to the output.

I've only ever seen that error when trying to delete an executable image when it was in use. On a good Unix platform, "man 2 open" will actually note more details about what "Text file busy" really means in the case of open() failing.

Indeed, open(2) says:

ETXTBSY
The file is a pure procedure (shared text) file that is being executed and the open() system call requests write access.

which doesn't match the name *.wav nor O_RDONLY so the original poster might want to check "man 2 open" on his particular operating system (and hope that it has "good" man pages in this respect).

- tye        


In reply to Re: Random script crashes related to File::Copy (care) by tye
in thread Random script crashes related to File::Copy by michael.barnes

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.