First of all the "script" always knows where it found files or directories because you program it where to search. When you code DirEx ("C:\\testdir\\*", listfilenames) don't you already know you are searching in C:\testdir? Secondary, SubDir can be used to implement recursive searches or recursive directory processing. You can also create a user-defined statement to be called recursively for each found directory. Let it have a parameter for the start path and call it recursively for every found directory appending directory name to the start path. If you tell me what you are trying to achieve I can suggest how that can be done. : I could not find any documentation that states that DirEx can search : subdirectories. Nor could I get DirEx to search subdirectories. (E.g. : DirEx ("C:\\testdir\\*", listfilenames) will only list the : filenames in testdir, and if testdir has subdirectories with files in : them, the subdirectories, or the files within the subdirectories are not : listed in listfilenames, and leaving off the last double backslash will : cause DirEx to look for files who's name begins with "testdir", : but it still will not search the subdirectories). : Also, what is the purpose and the reasoning behind having FileFindFirst and : FileFindNext search subdirectories, if the calling script has no idea : which subdirectory it found the file?
|