Re: Delete files older than X seconds.
| From: | * R&zE: | Date: | Fri, 31 Aug 2001 07:32:38 +0000 |
| Subject: | Re: Delete files older than X seconds. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65420@lists.php.net to get a copy of this message | ||
<Original message>
From: Julio Nobrega Trabalhando <inerteARROBAhotmail.com@pb1.pair.com>
Date: Thu, Aug 30, 2001 at 12:56:38PM -0300
Message-ID: <20010830222200.24369.qmail@pb1.pair.com>
Subject: [PHP] Delete files older than X seconds.
> Hi All,
>
> Another doubt. How can I delete files older than X seconds from a given
> folder?
>
> At the on-line manual I could only find a contributed note about 'discover
> time of last modification' from a file under a folder.
>
> Any help is appreciated.
>
> --
>
> Julio Nobrega
>
> A hora está chegando:
> http://toca.sourceforge.net
</Original message>
<Reply>
I don't exactly see any problem here. If you want files older than X
seconds, and you have a modification time... Then you can unlink()
them can't you?!
I think you pretty much found the solution yourself. But just in
case... Take a look at the following manual pages and create a
construction with them. I think these are all you need.
http://www.php.net/manual/en/function.opendir.php
http://www.php.net/manual/en/function.readdir.php
http://www.php.net/manual/en/function.closedir.php
(in order to scan your directory)
http://www.php.net/manual/en/function.stat.php
(in order to get the modification time)
Hope this helps... And if this wasn't the problem... Tell me/us!
</Reply>
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»»
-- Renze Munnik
-- DataLink BV
--
-- E: renze@datalink.nl
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««