Solved

filesearch

Posted on 1997-06-16
2
141 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb submit form as a POST request 4 263
delphi custom sort exception 6 135
QRReport  TQrmemo vertical stretching 1 42
Controlled Assessment GCSE - desperate help needed 4 75
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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