[Tutor] Directory Structure

Chris chris2014 at postbox.xyz
Sat Sep 30 01:35:51 EDT 2017


On Sat, 30 Sep 2017 00:23:45 +0100
Alan Gauld via Tutor <tutor at python.org> wrote:

> Probably the reason you can't find any modules out there is this
> is not something anyone would normally want to do. It would
> consume quite a lot of memory and provide little advantage
> (a little bit of speed) compared to building the lists (or
> copying the files) dynamically as you traverse the real
> directories.

Ok, then that's definitely the better solution.

> > Directory tree, it's called Maildir. Server is dovecot.
> > 
> > Create an archive elsewhere. Copything the mails isn't the problem.
> > Finding them is easy. I just don't know howto represent the tree in
> > the script.  
> 
> Are you sure you really need to?

It's more curiosity.

> If you know before you run the code what you need to extract
> you are usually better just scanning the folders and processing
> the data as you find it. That way you only traverse the tree
> once rather than once to build the tree then search the tree
> (in memory) and go back again to process the files.

OK.
 
> If you really need it in memory there are some generic modules
> for building tree structures in memory - you will need to
> define the mail objects of course the modules are data neutral,
> they just allow you to create and navigate the tree, populating
> it with whatever objects you want.

Ok, can you recommend some specific?

- Chris


More information about the Tutor mailing list