The problem with using a database is the files within the directory are
changing on, sometimes, a minute by minute basis. I think reading them into
the database then deleting them when they are deleted from the directory
would be a huge amount of overhead. No?

Something else which I did not make clear in my previous post; when the
files are removed from the directory I no longer want them displaying in my
web page.

Susan

-----Original Message-----
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 12:18 PM
To: Susan Ator
Cc: PHP-General
Subject: Re: [PHP] File read and sort question


On Mon, 2003-10-06 at 12:10, Susan Ator wrote:
> I have a directory with an ever-changing number of files. Some will be
> removed and others added on a continuing basis.
> 
> The files are ascii with the following layout:
> 
> <SENDER> Name
> <SUBJECT> Subject line
> <RELEASE_DATE> mm/dd/yyyy
> <RELEASE_TIME> hh:mm
> 
> I can easily get a list of files and pull the necessary information. I
need,
> however to be able to sort by RELEASE_DATE *and* RELEASE_TIME
> 
> Philosophically, what is the best way to handle this? I'm hesitant to pull
> all the information into an array and use ksort since there are, on
average,
> ~1000 messages in this directory which need to be processed.

Smells like a job for a database :)  Otherwise you'll need to either
read all the data in, or create another file heirarchy with the
appropriate redundancy to retrieve in sorted order, which incidentally
probably loads all the file names then sorts. Really it's a database,
database, database issue *grin*.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to