Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Automatically delete files

by sparkyichi (Deacon)
on Aug 02, 2005 at 14:47 UTC ( #480212=note: print w/replies, xml ) Need Help??

in reply to Automatically delete files

This type of thing should go in cron.

-A is last access and I think it is in epoc so I put it into an if statement:

if (-A $file >= $timeplusoneday){ unlink $file; }


Replies are listed 'Best First'.
Re: Automatically delete files
by MonkPaul (Friar) on Aug 02, 2005 at 14:51 UTC
    Ok, one thing that i forgot to mention though, for which i apologise, is that the user has a direct link to the file, where they click a hyper link and it opens in the browser, allowing them to save an updated version.

    With your suggestion, and a very valid one (lick butt here), is that if they access the file before the time expires it will stay on the server for another day, constantly.

    thanks though.

      The same would apply s/-A/-M/g

        Sure, but im sure -M checks for modification and not access as with -A. So in my view (not trying to be annoying here) is that if they can only save the file off the web and not actually modify the contents, then surely -M is the better choice.

        I may be wrong though, let me know if i am.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-04-19 22:27 GMT
Find Nodes?
    Voting Booth?