Posted by Jared Anderson on July 29, 1999 at 20:32:45:
Hey all
Just noticed a problem with my Find, though thankfully not a FUNCTIONALITY problem ....
I happened to notice that as I'm passing/storing my "path" string, sometimes it gets multiple subdirectories tagged on to the end of it!!
EXAMPLE: Say I've got a directory "c:\stuff", which has two subdirectories, "bob" and "pat". "bob" also has subdirectory "hill". [Don't ask me what the names represent, they just "came to me" lol]
Anyway, let's first say that in "bob\hill" is the file I want, "target.txt".
When I run my algorithm (Depth-First Search), it finds it, and the output is
"c:\stuff\bob\hill\target.txt".
NOW, let's say that instead, the file is in "pat". It still finds the file correctly, but the output is now
"c:\stuff\bob\hill\pat\target.txt".
When it's coming back out of the unsuccessful recursion into "bob", the string is not "reverting". Then it goes into the successful recursion into "pat".
Anyone know what I might do / what I left out / etc.? Or did I go about this the wrong way??
Thanks