def createFilePath(filePath): try: eos.lsl(filePath) except IOError: print "filePath = %s does not yet exist, creating it." % filePath eos.mkdir(filePath) time.sleep(3) eos.chmod(filePath, 777)
if not os.path.exists(currentFilePath): os.mkdir(currentFilePath) if outputFilePath.find("/castor") != -1: try: castor.rfstat(outputFilePath) except RuntimeError: print "outputFilePath does not yet exist, creating it." os.system("rfmkdir %s" % outputFilePath) os.system("rfchmod 777 %s" % outputFilePath) elif outputFilePath.find("/store") != -1: try: eos.lsl(outputFilePath) except IOError: print "outputFilePath does not yet exist, creating it." eos.mkdir(outputFilePath) else: hostname = socket.gethostname() numChars = min(len(hostname), len(outputFileMachine)) if outputFileMachine[:numChars] != hostname[:numChars]: raise ValueError("Cannot create output file path = %s on machine %s !!" % (outputFilePath, outputFileMachine)) if not os.path.isdir(outputFilePath): print "outputFilePath does not yet exist, creating it." createFilePath_recursively(outputFilePath) if not os.path.isdir("lxbatch"): os.mkdir('lxbatch') configFilePath = os.path.join(os.getcwd(), "lxbatch") if not os.path.isdir("lxbatch_log"):
def createFilePath(filePath): try: eos.lsl(filePath) except IOError: print "filePath = %s does not yet exist, creating it." % filePath eos.mkdir(filePath)
os.mkdir(currentFilePath) if outputFilePath.find("/castor") != -1: try: castor.rfstat(outputFilePath) except RuntimeError: print "outputFilePath does not yet exist, creating it." os.system("rfmkdir %s" % outputFilePath) os.system("rfchmod 777 %s" % outputFilePath) elif outputFilePath.find("/store") != -1: try: eos.lsl(outputFilePath) except IOError: print "outputFilePath does not yet exist, creating it." eos.mkdir(outputFilePath) else: hostname = socket.gethostname() numChars = min(len(hostname), len(outputFileMachine)) if outputFileMachine[:numChars] != hostname[:numChars]: raise ValueError( "Cannot create output file path = %s on machine %s !!" % (outputFilePath, outputFileMachine)) if not os.path.isdir(outputFilePath): print "outputFilePath does not yet exist, creating it." createFilePath_recursively(outputFilePath) if not os.path.isdir("lxbatch"): os.mkdir('lxbatch') configFilePath = os.path.join(os.getcwd(), "lxbatch")