mirror of
https://github.com/falk-werner/webfuse
synced 2024-10-27 20:34:10 +00:00
added timens to provider
This commit is contained in:
parent
4a2dd3e609
commit
bc0784acc6
@ -264,7 +264,8 @@ class FilesystemProvider:
|
|||||||
0x12: FilesystemProvider.mkdir,
|
0x12: FilesystemProvider.mkdir,
|
||||||
0x13: FilesystemProvider.readdir,
|
0x13: FilesystemProvider.readdir,
|
||||||
0x14: FilesystemProvider.rmdir,
|
0x14: FilesystemProvider.rmdir,
|
||||||
0x15: FilesystemProvider.statfs
|
0x15: FilesystemProvider.statfs,
|
||||||
|
0x15: FilesystemProvider.utimens,
|
||||||
}
|
}
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
@ -411,6 +412,21 @@ class FilesystemProvider:
|
|||||||
result = -ex.errno
|
result = -ex.errno
|
||||||
writer.write_result(result)
|
writer.write_result(result)
|
||||||
|
|
||||||
|
def utimens(self, reader, writer):
|
||||||
|
path = reader.read_path(self.root)
|
||||||
|
atime = reader.read_u64()
|
||||||
|
atime_ns = reader.read_u32()
|
||||||
|
mtime = reader.read_u64()
|
||||||
|
mtime_ns = reader.read_u32()
|
||||||
|
fd = reader.read_u64()
|
||||||
|
result = 0
|
||||||
|
try:
|
||||||
|
os.utime(path, (atime, mtime), ns = (atime_ns, mtime_ns))
|
||||||
|
except OSError as ex:
|
||||||
|
result = -ex.errno
|
||||||
|
writer.write_result(result)
|
||||||
|
|
||||||
|
|
||||||
def open(self, reader, writer):
|
def open(self, reader, writer):
|
||||||
path = reader.read_path(self.root)
|
path = reader.read_path(self.root)
|
||||||
flags = reader.read_openflags()
|
flags = reader.read_openflags()
|
||||||
|
Loading…
Reference in New Issue
Block a user