473,799 Members | 3,178 Online
Bytes | Software Development & Data Engineering Community
+ 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.Ge tFiles(mycontex t.Server.MapPat h(".\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 4830
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.ch a crit dans le message de news:
11************* *********@p15g2 00...legr 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.Ge tFiles(mycontex t.Server.MapPat h(".\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.ch wrote in message
news:11******** **************@ p15g2000hsd.goo glegroups.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.Ge tFiles(mycontex t.Server.MapPat h(".\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
13548
by: Sue | last post by:
How can I count the number of files in a folder? Thanks for all help!! Sue
6
3809
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 one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
6
4602
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 through an SqlCommand object, which accepts two input parameters which affect the query range. the problem she's experiencing is that with all input parameter values,
3
6418
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 = FolderBrowserDialog1.SelectedPath above are the 2 lines of code i have so far, i would like to display/add the files to a list view and i feel that i would have to count the amount of files in the specified directory to do so, so how would i count the amount of files...
3
3432
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 count the occurence of these trigger files. lets say my file is file.start
1
2060
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: <root> <filename>somefile.exe</filename> <bindata>bindata in base64 here</bindata> </root>
0
1365
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 file suppose file1 like ...
16
2045
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 execute it. However, I have tried to reduce the amount of data and the program runs fine. What could possibly be done to resolve this ?
9
13239
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 numOfLines = 0; byte bArr = new byte;
0
9686
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9540
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10250
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10222
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4139
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 we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.