Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^3: Correct code for deleting old file?

by rovf (Priest)
on Jun 18, 2012 at 08:16 UTC ( #976786=note: print w/replies, xml ) Need Help??

in reply to Re^2: Correct code for deleting old file?
in thread Correct code for deleting old file?

Basically i agree with you. I had assumed that you from your knowledge of your application, you know for sure that the names which you had collected in your file list, certainly contain plain files (and not directories, symbolic links or what else). In this case (only) it makes sense to omit the file testing.

If this is not the case, I personally would be interested *which* non-file entries made it into the file list, because this (possibly) signals an error. In this case, I would do a -f test for each file, but I would also issue an error message for those entries which are not plain files.

Ronald Fischer <>

Replies are listed 'Best First'.
Re^4: Correct code for deleting old file?
by cavac (Deacon) on Jun 18, 2012 at 17:29 UTC

    Thanks for the clarification.

    I'm not the OP. I was just curious. I've been avoiding unlink for non-files for something like a decade now. For a nanosecond there i thought maybe someone actually managed to to fix unlink in libc ;-)

    "You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976786]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-06-23 05:12 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.