Skip to content

Commit 356b3e3

Browse files
committed
[doc] Document getxattr / listxattr
1 parent 959c867 commit 356b3e3

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ It's just one file and is implemented using ctypes to use [libfuse](https://gith
66

77
# Installation
88

9+
Via [PyPI](https://pypi.org/project/mfusepy/):
10+
911
```bash
1012
pip install mfusepy
1113
```

mfusepy.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,6 @@ def getattr(self, path, fh=None):
17961796
raise FuseOSError(errno.ENOENT)
17971797
return {'st_mode': (S_IFDIR | 0o755), 'st_nlink': 2}
17981798

1799-
@_nullable_dummy_function
1800-
def getxattr(self, path, name, position=0):
1801-
raise FuseOSError(ENOTSUP)
1802-
18031799
@_nullable_dummy_function
18041800
def init(self, path):
18051801
'''
@@ -1829,8 +1825,27 @@ def link(self, target, source):
18291825

18301826
@_nullable_dummy_function
18311827
def listxattr(self, path):
1828+
'''
1829+
Return all extended file attribute keys for the specified path.
1830+
Should return an iterable of text strings.
1831+
'''
18321832
return []
18331833

1834+
@_nullable_dummy_function
1835+
def getxattr(self, path, name, position=0):
1836+
'''
1837+
Return the extended file attribute value to the specified (key) name and path.
1838+
Should return a bytes object.
1839+
'''
1840+
# I have no idea what 'position' does. It is a compatibility placeholder specifically for
1841+
# "if _system in ('Darwin', 'Darwin-MacFuse', 'FreeBSD'):", for which getxattr_t supposedly has
1842+
# an additional uint32_t argument for some reason. I think that including FreeBSD here might be a bug,
1843+
# because it also only uses libfuse. TODO: Somehow need to test this!
1844+
# MacFuse does indeed have that extra argument but also only in some overload, not in "Vanilla":
1845+
# https://github.com/macfuse/library/blob/6c26f28394c1cbda2428498c03e1f898c775404e/include/fuse.h#L1465-L1471
1846+
# It seems to be some kind of position, maybe to query very long values in a chunked manner with an offset?
1847+
raise FuseOSError(ENOTSUP)
1848+
18341849
@_nullable_dummy_function
18351850
def lock(self, path, fh, cmd, lock):
18361851
raise FuseOSError(errno.ENOSYS)

0 commit comments

Comments
 (0)