473,890 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Searching

We have a need to search through an entire drive for a specific file name.
The process is currently written with recursive loops through each directory
and the Scripting.FileS ystemObject. Problem is, it takes forever. When I
do a standard file search through Windows Explorer, it typically finds the
file I'm looking for within 5 seconds. Is there another approach to file
searching, or am I stuck with trying to make this recursive loop somehow
more efficient?

Thanks!
James
Jul 22 '05 #1
4 1651
Easiest thing that I did for this kind of problem for a client, was to
create a ActiveX component in VB6, then used this component on the client
web site.

Typical time to find a file was less than 10 seconds when the file was
located in a 20 level folder structure on a 100GB drive that was 85% full.

Hope it helps.

"James" <cp******@aol.c om> wrote in message
news:eO******** ********@TK2MSF TNGP14.phx.gbl. ..
We have a need to search through an entire drive for a specific file name.
The process is currently written with recursive loops through each
directory
and the Scripting.FileS ystemObject. Problem is, it takes forever. When I
do a standard file search through Windows Explorer, it typically finds the
file I'm looking for within 5 seconds. Is there another approach to file
searching, or am I stuck with trying to make this recursive loop somehow
more efficient?

Thanks!
James

Jul 22 '05 #2
It finds the file in 5sec, but is it DONE searching in 5sec?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"James" <cp******@aol.c om> wrote in message
news:eO******** ********@TK2MSF TNGP14.phx.gbl. ..
We have a need to search through an entire drive for a specific file name.
The process is currently written with recursive loops through each
directory
and the Scripting.FileS ystemObject. Problem is, it takes forever. When I
do a standard file search through Windows Explorer, it typically finds the
file I'm looking for within 5 seconds. Is there another approach to file
searching, or am I stuck with trying to make this recursive loop somehow
more efficient?

Thanks!
James

Jul 22 '05 #3
"James" wrote in message news:eO******** ********@TK2MSF TNGP14.phx.gbl. ..
: We have a need to search through an entire drive for a specific file name.

How unorganized is this drive?

: The process is currently written with recursive loops through each
directory
: and the Scripting.FileS ystemObject. Problem is, it takes forever.

And if your file was the last one searched, wouldn't Search also take a long
time although subsequent searches I believe are cached. So, if you cached
your search in FSO, would you get the same results by first searching your
cache?

: When I
: do a standard file search through Windows Explorer, it typically finds the
: file I'm looking for within 5 seconds.

This particular file or just in general. Define typically.

: Is there another approach to file
: searching, or am I stuck with trying to make this recursive loop somehow
: more efficient?

Perhaps a COMponent that can use APIs might be faster. Without seeing your
code, who knows if your routine can become more efficient?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #4
You need to index your data. Have a process that spiders your
site/files and then search that index. MS Index Service is probably
easiest, as it's built into Windows.
http://www.kevinroth.com/projects/project.asp?id=371
Cheers,
Daniel
http://www.danhendricks.com

Jul 22 '05 #5

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

Similar topics

6
1859
by: rakesh | last post by:
Hi, I have a requirement in which I need to search a string in a file stored on a harddisk. String which needs to be searched would be stored in a file with delimiter as new line character. some of the ways of doing this are 1. Read each line and do string compare immediately. 2. Read each line, add each string into a stl vector and search for the given string using stl bineary_search algorithm.
3
2099
by: Paul H | last post by:
I have a text file that contains the following: ******************** __StartCustomerID_41 Name: Fred Smith Address: 57 Pew Road Croydon
19
3232
by: Johnny Google | last post by:
Here is an example of the type of data from a file I will have: Apple,4322,3435,4653,6543,4652 Banana,6934,5423,6753,6531 Carrot,3454,4534,3434,1111,9120,5453 Cheese,4411,5522,6622,6641 The first position is the info (the product) I want to retreive for the corresponding code. Assuming that the codes are unique for each product and all code data is on one line.
60
49245
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
7
2629
by: pbd22 | last post by:
Hi. I am somewhat new to this and would like some advice. I want to search my xml file using "keyword" search and return results based on "proximity matching" - in other words, since the search string will often not produce a direct match, the results will be based on proximity (50%, 20% 100%, etc). are there any good examples out there on how to do keyword searches on XML data? How should i set up my xml file so
5
1859
by: bir | last post by:
I have a folder which contains the xml files with the word CICM in the filename (can also contain some other files) I need to search for all these xml files and create a single zip file for all these xml's. Currently i tried searching using the $File::Find. Please correct me in my code here or else if there's any other better option available. #Searching for the CICM files in CICM data folder find(sub { return if ($_ =~/^CICM/i);
4
5353
by: Hunk | last post by:
Hi I have a binary file which contains records sorted by Identifiers which are strings. The Identifiers are stored in ascending order. I would have to write a routine to give the record given the Identifier. The logical way would be to read the record once and put it in an STL container such as vector and then use lower_bound to search for a given identifier. But for some strange reason i'm asked to not use a container but instead...
9
2260
by: Hollywood | last post by:
Hello members of the comp.lang.c++, My log file is made of a set of 1000 following lines kind: 21/09/07 13:49:56,MW.SET.D_IGLS,2.000000 21/09/07 13:49:56,MW.SET.GNP_NT,7.000000 ..... commas ',' are used as field separators (data, name, value).
5
3564
by: Sevla | last post by:
hello guys i set this code , and i would like to know if its possible set "quotes" on the searched word. Thank You #word searching program within a txt file #!C:/perl/bin/perl.exe start:
0
9815
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
11215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10802
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...
0
10451
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...
1
8008
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6035
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4665
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
4259
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3267
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.