From 4aef8f667838dfa54102a4bd09de0d7eaeb6d1b9 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 25 Dec 2025 23:03:59 +0100 Subject: [PATCH] remove MacFuse (outdated), fixes #21 --- README.md | 1 - mfusepy.py | 26 ++++---------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4ad0095..5b5e466 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ While FUSE is (at least in the Unix world) a [Linux kernel feature](https://man7 - [libfuse](https://github.com/openbsd/src/tree/master/lib/libfuse) (OpenBSD) (fuse.h [2](https://github.com/openbsd/src/blob/master/lib/libfuse/fuse.h)) - [librefuse](https://github.com/NetBSD/src/tree/netbsd-8/lib/librefuse) (NetBSD) through [PUFFS](https://en.wikipedia.org/wiki/PUFFS_(NetBSD)) (fuse.h [2](https://github.com/NetBSD/src/blob/netbsd-8/lib/librefuse/fuse.h)) - [macFUSE](https://github.com/macfuse/macfuse) (macOS), previously called [osxfuse](https://osxfuse.github.io/), (fuse.h [2](https://github.com/osxfuse/fuse/blob/master/include/fuse.h) [3](https://github.com/macfuse/library/blob/6a8b90a0ab2685af918d5788cfdb5186f07351ce/include/fuse.h)) - - [MacFUSE](https://code.google.com/archive/p/macfuse/) (macOS), no longer maintained - [FUSE-T](https://www.fuse-t.org/) (macOS), [GitHub](https://github.com/macos-fuse-t/fuse-t) - [WinFsp](https://github.com/billziss-gh/winfsp) (Windows) (fuse.h [2](https://github.com/winfsp/winfsp/blob/master/inc/fuse/fuse.h) [3](https://github.com/winfsp/winfsp/blob/master/inc/fuse3/fuse.h)) - [Dokany](https://github.com/dokan-dev/dokany) (Windows) (fuse.h [2](https://github.com/dokan-dev/dokany/blob/master/dokan_fuse/include/fuse.h)) diff --git a/mfusepy.py b/mfusepy.py index 88b55b9..c207211 100644 --- a/mfusepy.py +++ b/mfusepy.py @@ -136,9 +136,6 @@ def reg32_get_value(rootkey, keyname, valname): raise OSError('Unable to find libfuse') _libfuse = ctypes.CDLL(_libfuse_path) -if _system == 'Darwin' and hasattr(_libfuse, 'macfuse_version'): - _system = 'Darwin-MacFuse' - def get_fuse_version(libfuse): version = libfuse.fuse_version() @@ -211,7 +208,7 @@ def get_fuse_version(libfuse): # for reasoning. # Set non-FUSE-specific kernel type definitions. -if _system in ('Darwin', 'Darwin-MacFuse', 'FreeBSD'): +if _system in ('Darwin', 'FreeBSD'): ENOTSUP = 45 c_dev_t: type = ctypes.c_int32 @@ -290,22 +287,7 @@ def get_fuse_version(libfuse): ('st_spare', ctypes.c_int64 * 9), ] else: - # Darwin-MacFuse fallback (legacy) - _c_stat__fields_ = [ - ('st_dev', c_dev_t), - ('st_ino', ctypes.c_uint32), - ('st_mode', c_mode_t), - ('st_nlink', ctypes.c_uint16), - ('st_uid', c_uid_t), - ('st_gid', c_gid_t), - ('st_rdev', c_dev_t), - ('st_atimespec', c_timespec), - ('st_mtimespec', c_timespec), - ('st_ctimespec', c_timespec), - ('st_size', c_off_t), - ('st_blocks', ctypes.c_int64), - ('st_blksize', ctypes.c_int32), - ] + raise NotImplementedError(_system + ' is not supported.') elif _system == 'Linux': ENOTSUP = 95 @@ -2106,10 +2088,10 @@ def getxattr(self, path: str, name: str, position: int = 0) -> bytes: Should return a bytes object. ''' # I have no idea what 'position' does. It is a compatibility placeholder specifically for - # "if _system in ('Darwin', 'Darwin-MacFuse', 'FreeBSD'):", for which getxattr_t supposedly has + # "if _system in ('Darwin', 'FreeBSD'):", for which getxattr_t supposedly has # an additional uint32_t argument for some reason. I think that including FreeBSD here might be a bug, # because it also only uses libfuse. TODO: Somehow need to test this! - # MacFuse does indeed have that extra argument but also only in some overload, not in "Vanilla": + # macFuse does indeed have that extra argument but also only in some overload, not in "Vanilla": # https://github.com/macfuse/library/blob/6c26f28394c1cbda2428498c03e1f898c775404e/include/fuse.h#L1465-L1471 # It seems to be some kind of position, maybe to query very long values in a chunked manner with an offset? raise FuseOSError(ENOTSUP)