Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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 <ynnor@mm.st>


Comment on Re^3: Correct code for deleting old file?
Select or Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976786]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-07-26 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls