jexd99
asked on
filesearch
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
and return the entire path name?
Thanks
-jexd99@aol.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
didn't clarify it enough. Let's say c:\windows\junkdir\myfile.
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