Solved

filesearch

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 90
Print Graphic and Text to Epson TM-T88v 12 260
how to change, disabled button color FMX ? 1 33
DBCtrlGrid, Delphi, Scroll 7 15
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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