On 29/09/17 18:02, Chris wrote:

> I'd like to store a directory tree in a python script.

That doesn't make much sense.
A directory tree is stored on the hard disk.
A python script is the source code to a program you execute

What do you mean by "store the directory tree in the script"?
Do you mean you want the script to copy an existing directory
tree? Or to create a new one? Or to store some kind of
representation of the tree in memory when your code runs?
Or create a static model of a directory tree in
your source code?
Or something else? - if so, what?

> Background: Maildirs with mails older than five years should be
> archived. The folder structure should be kept in the target.

Again that's not very clear.
Which mail system? Which OS? Some use a single file?
Others use a directory tree (so I'm guess you mean one of those)
and others use a database. (the representation as folders within
a mail client bears little resemblance to how the physical
data may be stored on disk)

And what are you trying to do? remove old folders from the
existing mail system - that could screw up its internal
integrity checking (checksums for example)~  - or create
an archive elsewhere?

> I was very surprised, that there seems no readily usable module
> available. (In Perl neither).

Once we understand what you actually want to do we might
find something suitable. But for now I have no clue what
exactly you need.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to