// List of functions defined in the module
//@-at
//@@c
+static char FuseInvalidate__doc__[] =
+ "Tell Fuse kernel module to explicitly invalidate a cached inode's contents\n";
+
+static PyObject *FuseInvalidate( PyObject *self, PyObject *args) {
+ char *path;
+ PyObject *ret;
+ int err;
+
+ PyString_Check(args);
+
+ path = PyString_AsString(args);
+
+ err = fuse_invalidate(fuse, path);
+
+ ret = PyInt_FromLong(err);
+
+ return(ret);
+}
static char FuseGetContext__doc__[] =
"Return the context of a filesystem operation in a dict. uid, gid, pid\n";
static PyMethodDef Fuse_methods[] = {
{"main", (PyCFunction)Fuse_main, METH_VARARGS|METH_KEYWORDS},
{"FuseGetContext", (PyCFunction)FuseGetContext, METH_VARARGS, FuseGetContext__doc__},
+ {"FuseInvalidate", (PyCFunction)FuseInvalidate, METH_VARARGS, FuseInvalidate__doc__},
{NULL, NULL} /* sentinel */
};
except:
pass
-from _fuse import main
+from _fuse import main, FuseGetContext, FuseInvalidate
+from string import join
import os, sys
from errno import *
self.optdict[k] = v
except:
self.optlist.append(o)
+
+ def GetContext(self):
+ return FuseGetContext(self)
+
+ def Invalidate(self, path):
+ return FuseInvalidate(self, path)
+
#@-node:__init__
#@+node:main
def main(self):
if hasattr( self, 'debug'):
d['lopts'] = 'debug';
- d['kopts'] = 'allow_other,kernel_cache';
+ k=[]
+ if hasattr(self,'allow_other'):
+ k.append('allow_other')
+
+ if hasattr(self,'kernel_cache'):
+ k.append('kernel_cache')
+ if len(k):
+ d['kopts'] = join(k,',')
+
for a in self._attrs:
if hasattr(self,a):
d[a] = ErrnoWrapper(getattr(self, a))