473,472 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to count huge amount of files in folder

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?

Mar 14 '07 #1
2 4802
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" <ww*****@gmx.cha crit dans le message de news:
11**********************@p15g2000hsd.googlegroups. 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?

Mar 14 '07 #2

"MichiMichi" <ww*****@gmx.chwrote in message
news:11**********************@p15g2000hsd.googlegr 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/
Mar 14 '07 #3

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

Similar topics

1
by: Sue | last post by:
How can I count the number of files in a folder? Thanks for all help!! Sue
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
6
by: jason | last post by:
hello everyone, one of my developers is working with a DataGrid component, which uses a DataTable as its DataSource. the DataTable is populated by a method which calls a stored procedure...
3
by: glub glub | last post by:
i'm trying to make a program that works as Replace works in MS Word but this is for use with files, not a text document. FolderBrowserDialog1.ShowDialog() txtPath.Text =...
3
by: umut.tabak | last post by:
Dear all, We have a multi-platform application(Windows-Linux). Linux part of our application is writing some input and trigger files on the a shared drive. What I want to do is to be able to...
1
by: rickbear | last post by:
Hi Group, I have an xml file wich contains a rootelement and a subelement with a filename and a subelement with bindata. In each xml file there is only one entry for each element. Like this: ...
0
by: ranganadh | last post by:
Dear Group members, I am new to LINQ, pls help on the deeling with huge amount of data with the C# stand Alone application. I have two file, which contains more then 2 lacs lines in every...
16
by: pereges | last post by:
ok so i have written a program in C where I am dealing with huge data(millions and lots of iterations involved) and for some reason the screen tends to freeze and I get no output every time I...
9
by: NvrBst | last post by:
Whats the best way to count the lines? I'm using the following code at the moment: public long GetNumberOfLines(string fileName) { int buffSize = 65536; int streamSize = 65536; long...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.