Re: temp file deletion strategies?
| From: | jeremy brand | Date: | Wed, 15 Nov 2000 07:11:57 +0000 |
| Subject: | Re: temp file deletion strategies? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25386@lists.php.net to get a copy of this message | ||
you might just want to run a cron job.. something like this...
#!/bin/sh
for i in
find /your/path -ctime -1 -print
do
rm -f "$i"
done
This would remove files that were created up to 1 day (-ctime -1).
(also see -cmin if you want minutes...)
-jeremy brand
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
---------------------------------------------------------------------
We cannot do everything at once, but we can do something at once.
-- Calvin Coolidge
On Wed, 15 Nov 2000, David P. Schwartz wrote:
> Date: Wed, 15 Nov 2000 00:07:25 -0700
> From: David P. Schwartz <davids@desertigloo.com>
> To: "php-general@lists.php.net" <php-general@lists.php.net>
> Subject: [PHP] temp file deletion strategies?
>
> If I send a temporary file to a client like this:
>
> $tempfile = create_file_somehow(...);
> header( "Content-type: application/octet-stream" );
> header( "Location: $tempfile" );
>
> What sort of strategies exist to make sure that the $tempfile gets deleted? Do
> I get control back after the second header executes?
>
> I'm thinking about situations where client-side caching is disabled and the same
> file needs to be created over and over (in my case, it will always have the same
> name each time it's created). Giving it a lifetime of an hour or so would be
> handy, but it needs to get deleted eventually.
>
> Thanks
> -David
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>