Document file filtering functions.

This commit is contained in:
Todd Gamblin
2014-10-27 14:42:48 -07:00
parent 4bf6930416
commit 4ecc7e1c93
3 changed files with 205 additions and 32 deletions

View File

@@ -144,6 +144,7 @@ def expand_user(path):
def mkdirp(*paths):
"""Creates a directory, as well as parent directories if needed."""
for path in paths:
if not os.path.exists(path):
os.makedirs(path)
@@ -163,6 +164,7 @@ def working_dir(dirname, **kwargs):
def touch(path):
"""Creates an empty file at the specified path."""
with closing(open(path, 'a')) as file:
os.utime(path, None)