status = myclient.mkdir(newSubDirs, MkDirFlags.MAKEPATH)
print status
This results in :
$ python createSubDir.py
Content of /eos/lhcb/xroot
2013-11-19 14:44:41 2 lhcb
2013-11-20 15:50:15 0 testDir
Attempting to create /eos/lhcb/xroot/newDir/newSubDir
(<status: 1, code: 400, ok: False, errno: 3011, error: True, message: '[ERROR] Server responded with an error: [3011] Unable to mkdir /eos/lhcb/xroot/newDir/newSubDir; No such file or directory\n', fatal: False, shellcode: 54>, None)
However, I can create the sub directories recursively myself
Hi,
the MkDirFlags.MAKEPATH does not seem effective to create the full tree structure:
from XRootD import client from XRootD.client.flags import DirListFlags, MkDirFlags
server = "root://eoslhcb.cern.ch" baseDir = "/eos/lhcb/xroot"
myclient = client.FileSystem(server) status, listing = myclient.dirlist(baseDir, DirListFlags.STAT)
print "Content of %s"%baseDir for entry in listing: print "\t{0} {1:>10} {2}".format(entry.statinfo.modtimestr, entry.statinfo.size, entry.name)
newSubDirs="/".join( [ baseDir, "newDir", "newSubDir" ]) print "Attempting to create %s"%newSubDirs
status = myclient.mkdir(newSubDirs, MkDirFlags.MAKEPATH) print status
This results in : $ python createSubDir.py Content of /eos/lhcb/xroot 2013-11-19 14:44:41 2 lhcb 2013-11-20 15:50:15 0 testDir Attempting to create /eos/lhcb/xroot/newDir/newSubDir (<status: 1, code: 400, ok: False, errno: 3011, error: True, message: '[ERROR] Server responded with an error: [3011] Unable to mkdir /eos/lhcb/xroot/newDir/newSubDir; No such file or directory\n', fatal: False, shellcode: 54>, None)
However, I can create the sub directories recursively myself
Cheers, Chris