summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-01-13 23:16:00 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-01-13 23:16:00 -0500
commit7827d255a7b98ae550edf9cd8d10cbfe0f01d1ab (patch)
treed46ad3fb531d7fead529677bc2cb916fde823a20
parentff9f0ada050d1b3d13862786a099a060f38c9169 (diff)
combox/file.py: added mk_nodedir function.
-rw-r--r--combox/file.py13
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.