[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

filesearch

Posted on 1997-06-16
2
Medium Priority
?
170 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 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

830 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