1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-20 18:27:40 +00:00

web running os

This commit is contained in:
kepler155c@gmail.com
2017-05-21 22:19:01 -04:00
parent 00c96a096b
commit 64146f8625
7 changed files with 108 additions and 116 deletions

View File

@@ -29,7 +29,7 @@ local function remoteCommand(node, msg)
error('netfs: Connection failed', 2)
end
local methods = { 'delete', 'exists', 'getFreeSpace', 'getSize', 'makeDir' }
local methods = { 'delete', 'exists', 'getFreeSpace', 'makeDir' }
local function resolveDir(dir, node)
dir = dir:gsub(node.mountPoint, '', 1)
@@ -101,6 +101,16 @@ function netfs.isReadOnly(node, dir)
})
end
function netfs.getSize(node, dir)
if dir == node.mountPoint and node.directory == '' then
return 0
end
return remoteCommand(node, {
fn = 'getSize',
args = { resolveDir(dir, node) },
})
end
function netfs.find(node, spec)
spec = resolveDir(spec, node)
local list = remoteCommand(node, {