Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read file list from a remote shared drive... LOTS of files 1

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Nov 21, 2003
4,772
US
I have several THOUSANDS of files that I need to see if files exist on.

If I do a fso.FileExists, the script times out looking through the files.

So I thought maybe if I loaded the whole file list into an array, then sifted through that for hits, it would work better.

Still times out.

Even the following times out:
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFiles = objFSO.GetFolder("\\10.0.0.9\COC\COC\")

Set fileList = objFiles.Files
For Each i in fileList
Response.Write i.Name & "<br>"
Next

... so any thoughts about how I can get a HUGE file list loaded up, or a faster method besides the FileSystemObject FileExists routine to find the files I'm looking for?

Once again, it's an ASP page, looking to see if a set of files exist on a remote share.

TIA!


Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
read the files into a database table, and search that table?
maybe you can import via the server (eg DTS/ Integration Services with MSSQL)? that should be a lot faster than a slow ASP script.
 
  • Thread starter
  • Moderator
  • #3
foxbox: Yeah... I'm playing with that now.... writing a T-SQL query to do just that... then run the T-SQL query every so often to make sure it's updated (I'll write a stored procedure after I get it to work).



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
I'm not sure if you can do this, but how a simple dir /b >somefile.txt and then just read it in?

 
  • Thread starter
  • Moderator
  • #5
JimHilton:

That's essentially what I did... except instead of going to a text file, I brought it into a database table for fast searching. It's almost instant now, and I just have it refresh the files at 1:00 a.m. daily.

If you'd like the code, I'll post it.


Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top