Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
26 changes: 4 additions & 22 deletions mfusepy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down