diff options
author | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-01-13 23:16:00 -0500 |
---|---|---|
committer | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-01-13 23:16:00 -0500 |
commit | 7827d255a7b98ae550edf9cd8d10cbfe0f01d1ab (patch) | |
tree | d46ad3fb531d7fead529677bc2cb916fde823a20 | |
parent | ff9f0ada050d1b3d13862786a099a060f38c9169 (diff) |
combox/file.py: added mk_nodedir function.
-rw-r--r-- | combox/file.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/combox/file.py b/combox/file.py index 775f1fd..2b6ac3c 100644 --- a/combox/file.py +++ b/combox/file.py @@ -21,6 +21,19 @@ from sys import exit from glob import glob +def mk_nodedir(nodes, directory): + """ + Creates directory `dir' inside the nodes. + """ + + abs_dir = path.abspath(directory) + + for node in nodes: + try: + os.mkdir(abs_dir) + except IOError: + print "Something wrong. report bug to sravik@bgsu.edu" + def split_data(data, n): """Split data into `n' parts and return them as an array. |