Hi,
I'm trying to use libXrdPosixPreload and python to get a listing of a directory that is under Xrootd control. ROOT is 5.26/00b on x86_64-slc5-gcc43-dbg. The preloaded library works great with the usual "ls" program but Python's directory access functions fail. Python is 2.5.4.
Below I show my test setup.
Under bash, this works:
LD_PRELOAD=$ROOTSYS/lib/libXrdPosixPreload.so \
XROOTD_VMP=daya0001:/xrootd/ \
/bin/ls root://daya0002//xrootd/
But, this doesn't:
LD_PRELOAD=$ROOTSYS/lib/libXrdPosixPreload.so \
XROOTD_VMP=daya0001:/xrootd/ \
python xrootd.py ls root://daya0002//xrootd/
For good measure, inside the "xrootd.py" program I also set the LD_PRELOAD and XROOTD_VMP variables like this:
def preload():
import os
rootsys = os.environ['ROOTSYS']
xrdpp = '%s/lib/libXrdPosixPreload.so'%rootsys
print 'Preloading "%s"'%xrdpp os.environ['LD_PRELOAD'] = xrdpp os.environ['XROOTD_VMP'] = 'daya0001:/xrootd/'return
The "ls" sub-command runs this little function:
def ls(path):
preload()
import os
return os.listdir(path)
But, it fails with:
However, some things do work from Python. For example I can successfully check for the existence of a path with:
def exists(path):
preload()
import os
return os.access(path,os.F_OK)
This:
LD_PRELOAD=$ROOTSYS/lib/libXrdPosixPreload.so \
XROOTD_VMP=daya0001:/xrootd/ \
python xrootd.py exists root://daya0002//xrootd/MDC09b/output/MDCLED_RACF_DRY_D11003.root
prints "True" and:
LD_PRELOAD=$ROOTSYS/lib/libXrdPosixPreload.so \
XROOTD_VMP=daya0001:/xrootd/ \
python xrootd.py exists root://daya0002//xrootd/bogus
gives "False" as it should.
So, anyone have any ideas?
Thanks!
-Brett.
This archive was generated by hypermail 2.2.0 : Sat Jul 03 2010 - 23:50:01 CEST