Category: Python

Aug 7 2009

Recursively delete folders with Python

Recursion

At work we've been doing some deploy optimization, and the need of automatically deleting (recursively) specific folders came up.

We use MXUnit to Unit Test our applications, and store all of our tests based on what they're related (inside _test folders). So basically we end up having lots of folders in our file structure that are not supposed to go into production for security reasons.

We use SVN for development, but don't use it on production for security reasons as well, so we always end up with a deploy package (SVN export) containing all of the files necessary for a specific release.

At the moment this package is generated, we still have our test cases in it, and it would be really painful to delete all the "_test" folders one by one if the release is too big.

We easily end up with something like:

Read more...

  comments - Posted by Marcos Placona at 11:00 AM - Categories: General Techie Stuff | Python | Technology







Related URLs

Subscribe

Categories

Search Archives

Monthly Archives