Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Automatically delete files

by sparkyichi (Deacon)
on Aug 02, 2005 at 14:47 UTC ( [id://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

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

      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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://480212]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-20 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found