|
-
Nov 11th, 2002, 03:48 PM
#1
Thread Starter
Member
Working with large amounts of files..
Hi all,
I work with document imaging software which requires me to write a great deal of custom code. The one issue I have always had is working with a large numbers of files. Currently in a folder I have a total of 38,124 files. I have a need to write each of the filenames to a file. This is all easy enough stuff, but it is -very- slow and seems to have memory leaks etc. I am using the FSO to do this.
Does anyone know of a fast way to access massive numbers of files?
Many thanks,
Darren Bridle
-
Nov 11th, 2002, 04:30 PM
#2
Hyperactive Member
If all you have to do is write the filenames to a file then you can do a DOS command for that.
DIR >Files.txt
If you have NT, XP, or 2K you can even put that in batch file and schedule it to run at a specified time (AT command)
-
Nov 11th, 2002, 04:37 PM
#3
Thread Starter
Member
Thats just one part of the software I am writing, so I really need to do it in the code.
-
Nov 11th, 2002, 04:46 PM
#4
Hyperactive Member
Here's an example. I don't know how fast it will run with the number of files you have but it's worth a try
VB Code:
Dim di As New System.IO.DirectoryInfo("C:\")
Dim fi As System.IO.FileInfo()
fi = di.GetFiles()
Dim j As Integer
For j = 0 To fi.Length - 1
Console.WriteLine(fi(j).Name)
Next
-
Nov 12th, 2002, 03:14 PM
#5
Thread Starter
Member
Thanks everyone for your replies.
Mag, your code seems to do the trick, its not super fast, but chugs through 38,000 files in about 10 seconds, which is fast enoguh for my purposes.
- Darren
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|