Skip to content

Commit

Permalink
[fix] fusepy: Make dummy Operations methods raise ENOSYS instead of E…
Browse files Browse the repository at this point in the history
…ROFS

fusepy/fusepy #81
  • Loading branch information
mxmlnkn committed Aug 30, 2024
1 parent 5445005 commit 5d75912
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions core/ratarmountcore/fusepy/fuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,10 +1106,10 @@ def access(self, path, amode):
bmap = None

def chmod(self, path, mode):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def chown(self, path, uid, gid):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def create(self, path, mode, fi=None):
'''
Expand All @@ -1120,7 +1120,7 @@ def create(self, path, mode, fi=None):
and return 0.
'''

raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def destroy(self, path):
'Called on filesystem destruction. Path is always /'
Expand Down Expand Up @@ -1170,18 +1170,18 @@ def ioctl(self, path, cmd, arg, fip, flags, data):
def link(self, target, source):
'creates a hard link `target -> source` (e.g. ln source target)'

raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def listxattr(self, path):
return []

lock = None

def mkdir(self, path, mode):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def mknod(self, path, mode, dev):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def open(self, path, flags):
'''
Expand Down Expand Up @@ -1227,10 +1227,10 @@ def removexattr(self, path, name):
raise FuseOSError(ENOTSUP)

def rename(self, old, new):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def rmdir(self, path):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def setxattr(self, path, name, value, options, position=0):
raise FuseOSError(ENOTSUP)
Expand All @@ -1249,21 +1249,21 @@ def statfs(self, path):
def symlink(self, target, source):
'creates a symlink `target -> source` (e.g. ln -s source target)'

raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def truncate(self, path, length, fh=None):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def unlink(self, path):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)

def utimens(self, path, times=None):
'Times is a (atime, mtime) tuple. If None use current time.'

return 0

def write(self, path, data, offset, fh):
raise FuseOSError(errno.EROFS)
raise FuseOSError(errno.ENOSYS)


class LoggingMixIn:
Expand Down

0 comments on commit 5d75912

Please sign in to comment.