mirror of
https://github.com/kepler155c/opus
synced 2025-10-21 18:57:41 +00:00
extended file listing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local linkfs = { }
|
||||
|
||||
local methods = { 'exists', 'getFreeSpace', 'getSize',
|
||||
'isDir', 'isReadOnly', 'list', 'makeDir', 'open', 'getDrive' }
|
||||
'isDir', 'isReadOnly', 'list', 'listEx', 'makeDir', 'open', 'getDrive' }
|
||||
|
||||
for _,m in pairs(methods) do
|
||||
linkfs[m] = function(node, dir, ...)
|
||||
|
@@ -29,7 +29,7 @@ local function remoteCommand(node, msg)
|
||||
error('netfs: Connection failed', 2)
|
||||
end
|
||||
|
||||
local methods = { 'delete', 'exists', 'getFreeSpace', 'makeDir' }
|
||||
local methods = { 'delete', 'exists', 'getFreeSpace', 'makeDir', 'list', 'listEx' }
|
||||
|
||||
local function resolveDir(dir, node)
|
||||
dir = dir:gsub(node.mountPoint, '', 1)
|
||||
@@ -125,16 +125,6 @@ function netfs.find(node, spec)
|
||||
return list
|
||||
end
|
||||
|
||||
function netfs.list(node, dir, full)
|
||||
dir = resolveDir(dir, node)
|
||||
|
||||
local r = remoteCommand(node, {
|
||||
fn = 'list',
|
||||
args = { dir, full },
|
||||
})
|
||||
return r
|
||||
end
|
||||
|
||||
function netfs.move(node, s, t)
|
||||
s = resolveDir(s, node)
|
||||
t = resolveDir(t, node)
|
||||
|
@@ -47,18 +47,8 @@ end
|
||||
function ramfs.list(node, dir, full)
|
||||
if node.nodes and node.mountPoint == dir then
|
||||
local files = { }
|
||||
if full then
|
||||
for f,n in pairs(node.nodes) do
|
||||
table.insert(files, {
|
||||
name = f,
|
||||
isDir = fs.isDir(fs.combine(dir, f)),
|
||||
size = fs.getSize(fs.combine(dir, f)),
|
||||
})
|
||||
end
|
||||
else
|
||||
for k,v in pairs(node.nodes) do
|
||||
table.insert(files, k)
|
||||
end
|
||||
for k,v in pairs(node.nodes) do
|
||||
table.insert(files, k)
|
||||
end
|
||||
return files
|
||||
end
|
||||
|
@@ -130,7 +130,7 @@ function MEProvider:insert(slot, qty)
|
||||
print(m)
|
||||
Logger.log('MEProvider', 'Insert failed, trying again')
|
||||
sleep(1)
|
||||
s, m = pcall(function() self.pullItem('up', slot, qty) end)
|
||||
s, m = pcall(function() self.pullItem(self.oside, slot, qty) end)
|
||||
if not s and m then
|
||||
print('MEProvider:pullItem')
|
||||
print(m)
|
||||
|
Reference in New Issue
Block a user