diff options
author | verigak <verigak@1ebed218-b0a3-11dd-8075-91d349ce83ee> | 2009-09-07 12:33:50 +0000 |
---|---|---|
committer | verigak <verigak@1ebed218-b0a3-11dd-8075-91d349ce83ee> | 2009-09-07 12:33:50 +0000 |
commit | 66d43446e80e876f19503a4a2136f0c6683b9974 (patch) | |
tree | 8dbbed5708ca2e2c5102adb10732159b1bd720ed /fuse.py | |
parent | 14d68215033ca115874e3ed4f2e3de918f344755 (diff) | |
download | fusepy-66d43446e80e876f19503a4a2136f0c6683b9974.tar.gz |
Expose init as discussed in Issue 18.
git-svn-id: http://fusepy.googlecode.com/svn/trunk@30 1ebed218-b0a3-11dd-8075-91d349ce83ee
Diffstat (limited to 'fuse.py')
-rw-r--r-- | fuse.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -181,7 +181,7 @@ class fuse_operations(Structure): c_char_p, POINTER(c_stat), c_off_t), c_off_t, POINTER(fuse_file_info))), ('releasedir', CFUNCTYPE(c_int, c_char_p, POINTER(fuse_file_info))), ('fsyncdir', CFUNCTYPE(c_int, c_char_p, c_int, POINTER(fuse_file_info))), - ('init', c_voidp), # Use __init__ + ('init', CFUNCTYPE(c_voidp, c_voidp)), ('destroy', c_voidp), # Use __del__ ('access', CFUNCTYPE(c_int, c_char_p, c_int)), ('create', CFUNCTYPE(c_int, c_char_p, c_mode_t, POINTER(fuse_file_info))), @@ -400,7 +400,10 @@ class FUSE(object): def fsyncdir(self, path, datasync, fip): # Ignore raw_fi return self.operations('fsyncdir', path, datasync, fip.contents.fh) - + + def init(self, conn): + return self.operations('init', '/') + def access(self, path, amode): return self.operations('access', path, amode) @@ -496,6 +499,11 @@ class Operations(object): def getxattr(self, path, name, position=0): raise OSError(ENOTSUP, '') + def init(self, path): + """Called on filesystem initialization. Path is always / + Use it instead of __init__ if you start threads on initialization.""" + pass + def link(self, target, source): raise OSError(EROFS, '') |