[PHP] Unlink file older then 7 days

2007-07-14 Thread chris
I have a directory with .txt and .txt.asc files. What I want to do is.. Check the age of all files ending in .txt.asc and if the file *.txt.asc is older then 7 days delete thatfile.txt.asc and also thatfile.txt Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] Unlink file older then 7 days

2007-07-14 Thread Ray
On Saturday 14 July 2007 9:16:06 pm [EMAIL PROTECTED] wrote: > I have a directory with .txt and .txt.asc files. > > What I want to do is.. > > Check the age of all files ending in .txt.asc > > and if the file *.txt.asc is older then 7 days > > delete thatfile.txt.asc and also thatfile.txt > look a

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread chris
How would I use fileatime to check if the file is older then 7 days? I have a directory with .txt and .txt.asc files. What I want to do is.. Check the age of all files ending in .txt.asc and if the file *.txt.asc is older then 7 days delete thatfile.txt.asc and also thatfile.txt -- PH

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Stut
[EMAIL PROTECTED] wrote: How would I use fileatime to check if the file is older then 7 days? You want filemtime not fileatime. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Suhas Pharkute
http://us.php.net/manual/en/function.fileatime.php $filename = 'somefile.txt'; if (file_exists($filename) && fileatime($filename) < (time()-(7*24*60*60)) ) { unlink($filename); } Read docs! Suhas On 7/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: How would I use fileatime to check

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Stut
Suhas Pharkute wrote: http://us.php.net/manual/en/function.fileatime.php $filename = 'somefile.txt'; if (file_exists($filename) && fileatime($filename) < (time()-(7*24*60*60)) ) { unlink($filename); } Read docs! You too! The OP wanted a way to "check the age of all files". The fileatime

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Ray
-Original Message- From: <[EMAIL PROTECTED]> To: Date: Mon, 16 Jul 2007 14:25:47 +0100 Subject: Re: [PHP] Unlink file older then 7 days > How would I use fileatime to check if the file is older then 7 days? > > > > something like: $access = fileatime (c:\pat

Re: [PHP] Unlink file older then 7 days

2007-07-17 Thread Richard Lynch
On Mon, July 16, 2007 8:40 am, Stut wrote: > Suhas Pharkute wrote: >> http://us.php.net/manual/en/function.fileatime.php >> >> $filename = 'somefile.txt'; >> if (file_exists($filename) && fileatime($filename) < >> (time()-(7*24*60*60)) ) >> { >>unlink($filename); >> } >> >> Read docs! > > You

Re: [PHP] Unlink file older then 7 days

2007-07-17 Thread chris
ot; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; Sent: Wednesday, July 18, 2007 2:17 AM Subject: Re: [PHP] Unlink file older then 7 days On Mon, July 16, 2007 8:40 am, Stut wrote: Suhas Pharkute wrote: http://us.php.net/manual/en/function.fileatime.php $filename = 'somef

Re: [PHP] Unlink file older then 7 days

2007-07-17 Thread Paul Scott
On Wed, 2007-07-18 at 07:29 +0100, [EMAIL PROTECTED] wrote: > I need to throw in a wildcard, how would I do that.. I have this so far. > which dont work. foreach(glob("*.asc.txt") as $files) { unlink($files); } --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.

Re: [PHP] Unlink file older then 7 days

2007-07-20 Thread Richard Lynch
Did you actually READ my previous post that you replied to?... On Wed, July 18, 2007 1:29 am, [EMAIL PROTECTED] wrote: > Ok thanks everyone... > > I need to throw in a wildcard, how would I do that.. I have this so > far. > which dont work. > > $filename = '/home/public_html/client/test/*.txt.asc