?
Solved

filesearch

Posted on 1997-06-16
2
Medium Priority
?
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
Quartz earned 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

770 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