Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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]
[Corion]: On the other hand, the Radeon 580 RX would cost 380 instead of 430 ... But still, that's ATi and I've been unhappy with ATi drivers the two times I had one in my desktops

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-08-21 08:41 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (319 votes). Check out past polls.