473,770 Members | 2,082 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 1646
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
1853
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
2093
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
3220
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
49192
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
2621
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
1853
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
5349
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
2258
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
3554
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
10232
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
10059
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
8891
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 project—planning, coding, testing, and deployment—without 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
7420
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
5313
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
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
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
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.