Re: [PHP] Delete files older than X seconds. From: * R&zE: (renze <email protected>)
Date: 08/31/01

<Original message>
From: Julio Nobrega Trabalhando <inerteARROBAhotmail.com <email protected>>
Date: Thu, Aug 30, 2001 at 12:56:38PM -0300
Message-ID: <20010830222200.24369.qmail <email protected>>
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 <email protected> -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>