Total number of files and directories

G

Guest

Hi,

I want to determine the total number of files and folders in the given
directory.
I have a solution to go recursively on each folder and make a count . But I
do not want to go recursively as it may reduce the performance.

Is there any direct function or property to detmine the numbers.

Atul Sureka
 
B

Barry Kelly

AtulSureka said:
I want to determine the total number of files and folders in the given
directory.
I have a solution to go recursively on each folder and make a count . But I
do not want to go recursively as it may reduce the performance.

Is there any direct function or property to detmine the numbers.

No.

-- Barry
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

AtulSureka said:
Hi,

I want to determine the total number of files and folders in the given
directory.
I have a solution to go recursively on each folder and make a count . But
I
do not want to go recursively as it may reduce the performance.

Is there any direct function or property to detmine the numbers.

Nop and yes, you could avoid the recursion but you will still would have to
"visit" each directory no matter what. You would just convert the recursion
to an iterative method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top