473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Number of files in a directory.

EDIT: I no longer need only specific file types in a directory, just
the total number of files!

Is there a more efficient way other than this:

string[] files = Directory.GetFiles(path);
count = files.length;
It seems like such a waste to have to create a full array of strings,
specially when the folder may contain thousands of files.

Thanks

Nov 16 '05 #1
1 20039
A very large number...
http://www.microsoft.com/resources/d...c_fil_tdrn.asp
<%= Clinton Gallagher
"supster" <pr*********@hotmail-dot-com.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
EDIT: I no longer need only specific file types in a directory, just
the total number of files!

Is there a more efficient way other than this:

string[] files = Directory.GetFiles(path);
count = files.length;
It seems like such a waste to have to create a full array of strings,
specially when the folder may contain thousands of files.

Thanks

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David T. Ashley | last post by:
Hi, PHP allows the "library" which can contain an arbitrary number of include files. Can I put all the include files right in this directory, or should I create subdirectories? My question...
4
by: Bart Plessers \(artabel\) | last post by:
Hello, I have an asp script that lists the files in a directory: CurrentPATH = "c:\temp\" Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder(CurrentPATH) Set...
2
by: Amy L. | last post by:
I am working on some code that will be used in a Windows Service that will monitor specific files in a queue. I would like to get an integer value of the amount of specfic files in a directory. ...
2
by: 73blazer | last post by:
Hello, I'm writing some C++ code, and I need to be able to find the number of files in a given directory. Is it possible under AIX4.3.3 with C++ 3.6.4? I cannot seem to locate anything of this...
1
by: jj | last post by:
Hi folks: I can get the list of files in a certain directory by using Directory.GetFiles("c:\temp"). But I want to get the number of files (ex. 20) within a directory including all...
1
by: sasikumar | last post by:
i have created a new folder inside project(say update for storing update files for software) how can i get total number of files in that folder.what will be full path for accessing that...
5
by: bhu | last post by:
Hi any idea how to get a set of files from a Directory, if a Directory contains 100 files i want to access 10 file at a time move it to a different directory , grab the next 10 do the same, Also...
8
by: theCancerus | last post by:
Hi All, I am not sure if this is the right place to ask this question but i am very sure you may have faced this problem, i have already found some post related to this but not the answer i am...
1
by: briggs | last post by:
Hi All, I need to take the count of txt and bak files present in all the directory.for eg if we assume there are two directoies say(test1, test2), I need to collect the count(of txt and bak files)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.