diff options
| author | uvok | 2025-01-19 15:02:15 +0100 | 
|---|---|---|
| committer | uvok | 2025-01-19 15:02:15 +0100 | 
| commit | ba49c8558029ef76225beb78172e0b7968771ee4 (patch) | |
| tree | a2d9af2ab205ec96d93e87a4f77cee85d5406c3b | |
| parent | 779dccaf6d9d144b0d88e955e0b9b6eca06738b4 (diff) | |
Cleanup code
| -rw-r--r-- | hello-fusepy.py | 21 | 
1 files changed, 5 insertions, 16 deletions
diff --git a/hello-fusepy.py b/hello-fusepy.py index 658d88e..7fc86c1 100644 --- a/hello-fusepy.py +++ b/hello-fusepy.py @@ -25,21 +25,16 @@ class HelloWorld(Operations, LoggingMixIn):      def __init__(self):          self.statuses: list[Status] = []          self.fd = 0 -        #     '/hello': { -        #         'st_mode': (stat.S_IFREG | 0o444),  # Regular file, read-only -        #         'st_nlink': 1, -        #         'st_size': len(self.files['/hello']), -        #     }      def getattr(self, path, fh=None):          (uid, gid, _) = fuse_get_context()          if path == "/":              return { -                    "st_mode": (stat.S_IFDIR | 0o700),  # Directory -                    "st_nlink": 2, -                    "st_uid": uid, -                    "st_gid": gid, -                } +                "st_mode": (stat.S_IFDIR | 0o700),  # Directory +                "st_nlink": 2, +                "st_uid": uid, +                "st_gid": gid, +            }          found = next((s for s in self.statuses if "/" + s.id == path), None)          if found:              return { @@ -72,13 +67,9 @@ class HelloWorld(Operations, LoggingMixIn):          if not self.statuses:              self.load_statuses()          dir_entries += self.list_dir() -        #     + [file[1:] for file in self.files.keys()] -        # else:          return dir_entries      def open(self, path, flags): -        # raise FuseOSError(errno.ENOENT) -        # if path not in self.files:          self.fd += 1          return self.fd @@ -87,8 +78,6 @@ class HelloWorld(Operations, LoggingMixIn):          if found:              return found.content.encode("utf8")          raise FuseOSError(errno.ENOENT) -        # if path in self.files: -        #     return self.files[path][offset:offset + size]  def main(mountpoint):  | 
