Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Correct code for deleting old file?

by rovf (Priest)
on Jun 18, 2012 at 08:16 UTC ( [id://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>

Replies are listed 'Best First'.
Re^4: Correct code for deleting old file?
by cavac (Parson) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://976786]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (None)
    As of 2024-04-25 04:04 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found