[Tutor] Move all files to top-level directory
dotancohen at gmail.com
Tue Apr 13 16:05:21 CEST 2010
> Actual the first item in the tuple (returned by os.walk) is singular (a
> string), so I might call it rootDir. Only the other two needed to be
> changed to plural to indicate that they were lists.
I did discover this, too. I wanted to finish with the code at hand
before I started experimenting with things.
> Note that it's not just race conditions that can cause collisions. You
> might have the same name in two distinct subdirectories, so they'll end up
> in the same place. Which one wins depends on the OS you're running, I
The code checks for that, and assigns a different filename if the name
is already taken. See the renameNumber variable.
Thank you very much for your help.
More information about the Tutor