From 7827d255a7b98ae550edf9cd8d10cbfe0f01d1ab Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Tue, 13 Jan 2015 23:16:00 -0500 Subject: combox/file.py: added mk_nodedir function. --- combox/file.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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. -- cgit v1.2.3