def __init__(self, *args, **kw): Fuse.__init__(self, *args, **kw) if True: print "xmp.py:Xmp:mountpoint: %s" % repr(self.mountpoint) print "xmp.py:Xmp:unnamed mount options: %s" % self.optlist print "xmp.py:Xmp:named mount options: %s" % self.optdict # do stuff to set up your filesystem here, if you want #thread.start_new_thread(self.mythread, ()) self.cfg_location = kw['cfg_location'] self.hf = HydraFile.HydraFile(self.cfg_location) self.openfiles = {}
####################################################################################### import sys,os sys.path.append(os.path.join(os.getcwd(),'..')) from common import HydraFile from common.fs_db import * from common.fs_objects import * if __name__ == '__main__': if len(sys.argv) < 2: print "Please provide a filename as parameter." sys.exit(0) file = sys.argv[1] hf = HydraFile.HydraFile('../conf/fileclient1.xml') try: (file,children) = hf.stat(file) print file for i in children: print i except Exception, e: print e
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # ####################################################################################### from common import HydraFile import struct BLOCK_SIZE = 65536 BLOCKS = 8 import sys file = '/' + sys.argv[1].split('/')[-1] hf = HydraFile.HydraFile('conf/fileclient1.xml') hf.open(file, 'w') buf = '0'# + struct.pack('b',0) buf *= BLOCK_SIZE for i in range(BLOCKS): hf.write(buf) hf.close() print "Waiting 5 seconds..." import time time.sleep(5) print "Initializing clients..." clients = []