示例#1
0
 def change_val(self, *args):
     try:
         new_val = type(self.parent_dict[self.key])(*args)
     except (TypeError, ValueError):
         raise fsbase.NFSError(rfc1094.NFSERR_ACCES)
     self.parent_dict[self.key] = new_val
     self.data = self.get_data()
     self.set_size()
     # This is "rebind", not "mutate".
     self.mtime = fsbase.mk_now()
示例#2
0
 def check_changed(self):
     """Called on every access.  Stringifies data, and compares it
     with old value to see if it's changed (so that when the python
     side changes a value, we reflect that with a changed mtime in
     GETATTR, and the NFS client can reread if necesary.This is
     comparatively heavyweight, and maybe there should be a flag to
     turn it off."""
     if self.type != rfc1094.NFDIR:
         new_data = self.get_data()
         if new_data != self.data:
             self.mtime = fsbase.mk_now()
             self.data = new_data
             self.set_size()
示例#3
0
 def get_fil(self, fh):
     f = self._fils.get(fh, None)
     if f != None:
         f.check_changed()
         f.atime = fsbase.mk_now()
     return f