[Pythonmac-SIG] Stupid OS.WALK tricks?
Schollnick, Benjamin
Benjamin.Schollnick@usa.xerox.com
Tue, 13 Nov 2001 11:30:49 -0500
Folks,
I'm attempting to optimize a quick program, but os.walk
is sort of interferring...
I'm searching a directory tree for graphic file.... using
os.walk, and when it finds the file, it copies it to a local
directory...
The "problem" here, is that I can't figure out how to
stop OS.walk (in the visit function) from "continuing"
through the rest of the directories, and to just move
on to the next file... (There should only be one match)..
I figure I'm going to have to write a custom walk to
deal with this scenario.... Does anyone have anything
similiar? Or suggestions on dealing with this?
Doing a "return" or "Break" during the search doesn't seem
to do this....
- Benjamin
- Benjamin