File deletion after 72 hours of creation

skip at pobox.com skip at pobox.com
Thu Mar 29 12:02:17 EDT 2007


    Alex> I'm looking for a simple method to delete a folder after 72
    Alex> "Business hours" (saturday/sunday doesnt count) since its
    Alex> creation. Note that This is on a linux system and I realize that
    Alex> it will be the last modified time. These files wont be modified
    Alex> since their creation.

    Alex> Im very confused on how to work with the number easily.

Take a look at the dateutil module.  Its relativedelta object has some
weekday sense:

    http://labix.org/python-dateutil

Skip



More information about the Python-list mailing list