X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-routefs.git/blobdiff_plain/01caa607a4f1c1d0bd5188d24cd940f4d084a1b2..f2e13ce53aa1209779400a61c7779b87b280f7f8:/routefs/__init__.py diff --git a/routefs/__init__.py b/routefs/__init__.py index 5af78a5..5137256 100644 --- a/routefs/__init__.py +++ b/routefs/__init__.py @@ -86,6 +86,10 @@ class RouteFS(fuse.Fuse): return controller = match.pop('controller') result = getattr(self, controller)(**match) + if type(result) is str: + result = File(result) + if type(result) is list: + result = Directory(result) return result def readdir(self, path, offset): @@ -113,14 +117,14 @@ class RouteFS(fuse.Fuse): st = RouteStat() if type(obj) is Directory: - st.st_mode = stat.S_IFDIR | 0755 + st.st_mode = stat.S_IFDIR | obj.mode st.st_nlink = 2 elif type(obj) is Symlink: - st.st_mode = stat.S_IFLNK | 0777 + st.st_mode = stat.S_IFLNK | obj.mode st.st_nlink = 1 st.st_size = len(obj) else: - st.st_mode = stat.S_IFREG | 0444 + st.st_mode = stat.S_IFREG | obj.mode st.st_nlink = 1 st.st_size = len(obj)