Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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 <>

Comment on Re^3: Correct code for deleting old file?
Select or Download Code
Replies are listed 'Best First'.
Re^4: Correct code for deleting old file?
by cavac (Chaplain) 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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2015-10-13 22:29 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (316 votes), past polls