At 08:41 am 7/5/01 -0700, Oliver Hotz wrote:
>Hey guys, I have a php script that generates files, and a www page that
>links to them.
>
>Is there a way to delete those files, based on a time variable ?..

Why not have cron kick off a script every minute that checks all candidate 
files and deletes the ones that need it. You can either embed the delete 
criteria within the file name or alternatively have the program which 
creates the candidate files post entries to a control file which the cron 
pgm reads.

What about updating the links on the webpage though? You'll have to handle 
this too unless the page is written by a program which generates links on 
the fly based on candidate file availability. Like generating the links 
from a read of the candidate file directory.

Of course you'll want a very appealing 404 handler (see .htaccess for 
those) because the webpage could be invoked by a visitor to the site 
displaying links that are clobbered some seconds/minutes later by the cron 
job. Then the visitor clicks and it ain't there. :(

Maybe there's a better way to accomplish what you're after??

hth,

Marty

Face 2 Interface Web Solutions
Website Creation Made SIMPL(tm)
Online Demo Available
http://face2interface.com/Home/Demo.shtml


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to