Fix reversed parameters in link() and symlink() implementations.

Yes, it is a bit strange how fusepy reverses these parameters when
calling into the Operations object, but they are indeed reversed.

This patch fixes the example to work correctly when symlinking
or linking in the passthrough.
This commit is contained in:
Tristan Van Berkom 2017-06-11 20:53:33 +09:00
parent a01a80b91c
commit 2c7956c739

View file

@ -82,13 +82,13 @@ class Passthrough(Operations):
return os.unlink(self._full_path(path)) return os.unlink(self._full_path(path))
def symlink(self, name, target): def symlink(self, name, target):
return os.symlink(name, self._full_path(target)) return os.symlink(target, self._full_path(name))
def rename(self, old, new): def rename(self, old, new):
return os.rename(self._full_path(old), self._full_path(new)) return os.rename(self._full_path(old), self._full_path(new))
def link(self, target, name): def link(self, target, name):
return os.link(self._full_path(target), self._full_path(name)) return os.link(self._full_path(name), self._full_path(target))
def utimens(self, path, times=None): def utimens(self, path, times=None):
return os.utime(self._full_path(path), times) return os.utime(self._full_path(path), times)