[PHP] Number of files in a dir

2002-11-01 Thread Shaun Thornburgh
How can i find out how many files exist in a dir?



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




Re: [PHP] Number of files in a dir

2002-11-01 Thread rija
cope with readdir() or dir().
I always use one of these functions and I'm wondered if there are more
efficient solution to do it !

- Original Message -
From: Shaun Thornburgh [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 02, 2002 9:00 AM
Subject: [PHP] Number of files in a dir


 How can i find out how many files exist in a dir?



 --
 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




Re: [PHP] number of files in a dir vs. performace

2002-07-22 Thread Jason Wong

On Tuesday 23 July 2002 11:09, eat pasta type fasta wrote:
 I'm using mysql to hold references to image files then served on my pages
 via PHP.

 I have typically a set of two files:

 thumb and a large original, on occasion there is also a variant inreasing
 the set to 3 per image

 currently I am holding all of the files in 1 directory since the DB can
 keep track of them, however their number has grown to over 400 at this
 point

 my issue is whether it would be worth it (performance wise) to split them
 into thumbs and works thus having 200+ files per directory as opposed to
 so many, I am expecting the number of images to double in the future.

Nothing to do with PHP and everything to do with the OS. FWIW 20K files in one 
directory on Linux is slow.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Yow!  Are we wet yet?
*/


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




[PHP] number of files in a dir vs. performace

2002-07-22 Thread eat pasta type fasta

I'm using mysql to hold references to image files then served on my pages 
via PHP.

I have typically a set of two files:

thumb and a large original, on occasion there is also a variant inreasing 
the set to 3 per image

currently I am holding all of the files in 1 directory since the DB can 
keep track of them, however their number has grown to over 400 at this 
point

my issue is whether it would be worth it (performance wise) to split them 
into thumbs and works thus having 200+ files per directory as opposed to 
so many, I am expecting the number of images to double in the future.

R

--__-__-__
eat pasta
type fasta


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




Re: [PHP] number of files in a dir vs. performace

2002-07-22 Thread Miguel Cruz

On Mon, 22 Jul 2002, eat pasta type fasta wrote:
 currently I am holding all of the files in 1 directory since the DB can 
 keep track of them, however their number has grown to over 400 at this 
 point
 
 my issue is whether it would be worth it (performance wise) to split them 
 into thumbs and works thus having 200+ files per directory as opposed to 
 so many, I am expecting the number of images to double in the future.

400 is not very many. Tens of thousands can start to become a problem.

Look at the distribution of your file names and come up with a hashing 
mechanism. For instance, if your filenames are numbers, create 
subdirectories 0/ 1/ 2/ 3/ 4/ etc., and place the files based on their 
final digit.

miguel


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