Solved

filesearch

Posted on 1997-06-16
2
138 Views
Last Modified: 2010-08-05
How can I get a directory path if I only know the first part of the directory path + the file name?  Filesearch appears to work if I plug in some complete paths with a known file name, but if the file myfile.txt exists in c:\windows\testdir\myfile.txt and I know this file is somewhere in the windows directory (i.e. c:\windows, but it could be anywhere beyond that), is there a function to return c:\windows\testdir ?  In other words, search the directory path (including subdirectories ), find the file,
and return the entire path name?
              Thanks
                   -jexd99@aol.com
0
Comment
Question by:jexd99
2 Comments
 

Accepted Solution

by:
Quartz earned 50 total points
ID: 1337086
Sorry for my english...
There is no build-in procedure or function in Pascal or Delphi for that task. You have to make a function by your self.
Make a recursive function to check all sub-directory automatically.

Upgrade the value of your question by 100 if you whant i write the code for you.

0
 

Author Comment

by:jexd99
ID: 1337087
This answered my question..... but :)......... I probably
didn't clarify it enough.  Let's say c:\windows\junkdir\myfile.txt
exists.  I know it is in c:\windows, but if I don't know the
name of the directories beyond that, I cannot use a chdir to
change directories, or getdir to get directories, etc....
You said use recursion, and although I know recursion, I don't
know how to access a directory which can be any name. I use
Delphi 1 with Win 95. Is there a delphi command which can get
me an unknown directory in a directory path?  ... or subsequently
traverse through many directory paths?  
                     Thanks again :)
                        jexd99@aol.com
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now