Added support for returning a writable File object. Added write sysctl.
authorPeter Iannucci <iannucci@mit.edu>
Tue, 18 Nov 2008 07:00:56 +0000 (02:00 -0500)
committerPeter Iannucci <iannucci@mit.edu>
Tue, 18 Nov 2008 07:06:01 +0000 (02:06 -0500)
Signed-off-by: Peter Iannucci <iannucci@mit.edu>

routefs/__init__.py

index c3b0357..069f925 100644 (file)
@@ -122,6 +122,13 @@ class RouteFS(fuse.Fuse):
         If the path specified is a symlink, return the target
         """
         return self._get_file(path).readlink()
+    
+    def write(self, path, buf, offset):
+        """
+        If the path specified is a file, call the appropriate member 
+        on the file
+        """
+        return self._get_file(path).write(buf, offset)
 
 class TreeKey(object):
     def getattr(self):
@@ -132,6 +139,8 @@ class TreeKey(object):
         return -errno.EINVAL
     def readlink(self):
         return -errno.EINVAL
+    def write(self, length, offset):
+        return -errno.EINVAL
 
 class NoEntry(TreeKey):
     def getattr(self):
@@ -142,6 +151,8 @@ class NoEntry(TreeKey):
         return -errno.ENOENT
     def readlink(self):
         return -errno.ENOENT
+    def write(self, length, offset):
+        return -errno.ENOENT
 
 class TreeEntry(TreeKey):
     default_mode = 0444