Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to count huge amount of files in folder

Reply
Thread Tools

How to count huge amount of files in folder

 
 
MichiMichi
Guest
Posts: n/a
 
      03-14-2007
My asp.net application has a directory which is filled up with over 17
files (email) a second. After a while this sums up into a huge amount
of files.

I usually count files with the GETFILES method. This works perfectly
of there are only a few hundert files in the folder

*********
.....
Dim files() As String
files = IO.Directory.GetFiles(mycontext.Server.MapPath(".\ myFolder
\"), "*")
.....
*********

When my application goes offline than it can happen that over 200,000
files are waiting in the folder to be processed.
The method GETFILES does not work anymore. There are just to many
files. I can wait for hours any nothing happens.

Is there a better method to count files inside a folder for ASP.NET
2.0?

 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      03-14-2007
You could try win32. If I remember the problem is that the collection
returns data once all files are processed. Win32 allows to return each name
in turn plus it could be quicker if you are not even interested in storing
details...

Also another option would be to closely look if you really need this number
(for example you could perhaps queue this to a file or a DB or in different
directories to avoid overblotting a single directory, or you could number
your files and using the last processed and last created could give a usable
value depdning what you are doing with this number etc...).


"MichiMichi" <> a écrit dans le message de news:
. com...
> My asp.net application has a directory which is filled up with over 17
> files (email) a second. After a while this sums up into a huge amount
> of files.
>
> I usually count files with the GETFILES method. This works perfectly
> of there are only a few hundert files in the folder
>
> *********
> ....
> Dim files() As String
> files = IO.Directory.GetFiles(mycontext.Server.MapPath(".\ myFolder
> \"), "*")
> ....
> *********
>
> When my application goes offline than it can happen that over 200,000
> files are waiting in the folder to be processed.
> The method GETFILES does not work anymore. There are just to many
> files. I can wait for hours any nothing happens.
>
> Is there a better method to count files inside a folder for ASP.NET
> 2.0?
>



 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-14-2007

"MichiMichi" <> wrote in message
news: oups.com...
> My asp.net application has a directory which is filled up with over 17
> files (email) a second. After a while this sums up into a huge amount
> of files.
>
> I usually count files with the GETFILES method. This works perfectly
> of there are only a few hundert files in the folder
>
> *********
> ....
> Dim files() As String
> files = IO.Directory.GetFiles(mycontext.Server.MapPath(".\ myFolder
> \"), "*")
> ....
> *********
>
> When my application goes offline than it can happen that over 200,000
> files are waiting in the folder to be processed.
> The method GETFILES does not work anymore. There are just to many
> files. I can wait for hours any nothing happens.
>
> Is there a better method to count files inside a folder for ASP.NET
> 2.0?
>


Take a look this article
http://msdn.microsoft.com/msdnmag/is...12/NETMatters/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Trouble with huge amount of State Server Sessions Timed out =?Utf-8?B?RGFuaWVsIFdhbHplbmJhY2g=?= ASP .Net 7 09-28-2006 03:36 PM
Huge amount of invisible rubbish in C:\WINDOWS\Local Settings\Temporary Internet Files nemo Computer Support 33 03-22-2005 03:45 AM
Clicking a "mailto:" link on a page opens huge amount of IE windows after a while Henk Jol Firefox 1 01-04-2005 10:13 PM
Efficient format for huge amount of data Gabriel Genellina Java 21 01-23-2004 10:56 PM



Advertisments