Forum Moderators: phranque

Message Too Old, No Replies

What is the limit of the number of files listed in a directory?

FTP will only list X number of files in a directory before it cuts off.

         

JAB Creations

7:25 pm on Aug 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you do a list command in FTP what is the maximum number of files listed that will be returned?

- John

rocknbil

5:04 pm on Aug 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I would say that is directly proportionate to the timeout of your FTP client divided by the amount of data your connection can supply per second, minus the speed your FTP client can parse the directory into a display. :-)

I don't think there's a limitation on the number of files in a directory, for either the OS or any FTP client. This is a limitation of the FTP program you're using and the time it takes to compile the list every time you chdir.

I learned long ago that huge directories are a maintenance nightmare and counterproductive for this very reason. At this point you probably don't want to hear "create subdirectories" but even if you did get them all to display, there's that agonizing wait every time you want to chdir . . . .

For the current situation you could try getting your ISP to increase your FTP timeout, and make sure it's set to a higher number in your FTP client. But either way you look at it, it's a "wait" you can do without.

JAB Creations

5:34 pm on Aug 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Bill, I figured it would be best to limit any sort of files/records/etc to one thousand segments tops: 1~999, 1000~1999, 2000~2999, etc.

The same thing in application to each set of one thousand items, only one thousand sub-folders in each folder (for really large "collections").

- John

incrediBILL

2:39 am on Aug 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a directory on the server with about 35K files in it and it performs OK.

However, I never do a directory on the files, and if I do it's via SSH and I pipe the output to a file and then use GREP to find what I want.

Additionally, I only FTP files up to that specific directory using command line FTP instead of those GUI FTP programs which try to pretend it's a "folder" the subsequently choke and die with the heavy load of files. If I do need to upload with the GUI FTP for whatever reason, I upload the files into a blank "upload" directory and then move them to their final destination on the server which avoids that nonsense as well.

Typically, I'd say about 1K-4K files per directory is enough but I'm a glutton for punishment.

[edited by: incrediBILL at 2:41 am (utc) on Aug. 24, 2008]

rocknbil

5:00 pm on Aug 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Apparently so, how do you ever find anything! :-)

incrediBILL

5:52 pm on Aug 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



We're talking thumbnail screen shots, I don't need to find them, the software does ;)

encyclo

12:53 am on Aug 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Certain FTP daemons such as proFTPd have configuration options which limit the number of files listed, to conserve system resources. The system administrator can fix these limits, there is no standard maximum value. See:

[proftpd.org...]

incrediBILL

4:39 am on Aug 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



However, some of the FTP tools use standard windows controls to list their files which do have limits to how many lines of data they can display so even if the tool downloads the entire list it may not be able to display it unless they used a 3rd party control that breaks that barrier.