[Tutor] Directory Structure

Mats Wichmann mats at wichmann.us
Fri Sep 29 14:16:11 EDT 2017


On 09/29/2017 11:02 AM, Chris wrote:
> Hello,
> 
> I'd like to store a directory tree in a python script.
> 
> Background: Maildirs with mails older than five years should be
> archived. The folder structure should be kept in the target.
> 
> I was very surprised, that there seems no readily usable module
> available. (In Perl neither).
> 
> What's the best way to save them?

It's not clear what you're really looking for...

File/directory usage is really an OS-specific thing, and most of the
functionality you want seems like it would be in the os module.

Have you looked at functions like os.renames() and os.makedirs()?

Do you need something much more complicated than that?




More information about the Tutor mailing list