Message110719
As discussed in python-dev mailing list, something should be add to os.mkdir() and os.makedirs() to simulate the shell's "mkdir -p" function, that is, suppress the OSError exception if the target directory exists.
Here is a patch against py3k, with code, test and doc. I add an "ensure_exist" keyword argument for both os.mkdir() and os.makedirs(), indicates weather an OSError is raised if the target directory already exists.
Since I've no windows environment, I only tested the patch on Unix. Hope someone could help test it on windows. |
|
Date |
User |
Action |
Args |
2010-07-19 08:47:35 | ysj.ray | set | recipients:
+ ysj.ray |
2010-07-19 08:47:35 | ysj.ray | set | messageid: <1279529255.89.0.917982060428.issue9299@psf.upfronthosting.co.za> |
2010-07-19 08:47:33 | ysj.ray | link | issue9299 messages |
2010-07-19 08:47:33 | ysj.ray | create | |
|