You have no guarantee that on the next run the directories will be
visited in the same order as in the first run (this could depend on the
filesystem). So then remembering a last directory won't do it. You could
write each completed directory name to a file, and then on the second
run check whether
Steve Howell wrote:
If that's the case, then you might be able to get away with just
leaving some kind of breadcrumbs whenever you've successfully
processed a directory or a file,
Unless you're indexing a read-only device (whether hardware
read-only like a CD, or permission-wise read-only like
On Wed, 17 Mar 2010 20:08:48 -0700, alex23 wrote:
> Steven D'Aprano wrote:
>> # Untested
>> last_visited = open("last_visited.txt", 'r').read()
>> for root, dirs, files in os.walk(last_visited or basedir):
>> open("last_visited.txt", 'w').write(root) run program
>
> Wouldn't this only walk
On Mar 17, 3:04 pm, Keir Vaughan-taylor wrote:
> I am traversing a large set of directories using
>
> for root, dirs, files in os.walk(basedir):
> run program
>
> Being a huge directory set the traversal is taking days to do a
> traversal.
> Sometimes it is the case there is a crash because of
Keir Vaughan-taylor wrote:
I am traversing a large set of directories using
for root, dirs, files in os.walk(basedir):
run program
Being a huge directory set the traversal is taking days to do a
traversal.
Sometimes it is the case there is a crash because of a programming
error.
As each dir
Steven D'Aprano wrote:
> # Untested
> last_visited = open("last_visited.txt", 'r').read()
> for root, dirs, files in os.walk(last_visited or basedir):
> open("last_visited.txt", 'w').write(root)
> run program
Wouldn't this only walk the directory the exception occured in and not
the rem
En Wed, 17 Mar 2010 19:04:14 -0300, Keir Vaughan-taylor
escribió:
I am traversing a large set of directories using
for root, dirs, files in os.walk(basedir):
run program
Being a huge directory set the traversal is taking days to do a
traversal.
Sometimes it is the case there is a crash
On Wed, 17 Mar 2010 15:04:14 -0700, Keir Vaughan-taylor wrote:
> I am traversing a large set of directories using
>
> for root, dirs, files in os.walk(basedir):
> run program
>
> Being a huge directory set the traversal is taking days to do a
> traversal.
> Sometimes it is the case there is