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

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


Sparky
FMTEYEWTK


Comment on Re: Automatically delete files
Download Code
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

      Sparky
      FMTEYEWTK
        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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-08-21 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (135 votes), past polls