1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-21 18:57:41 +00:00

extended file listing

This commit is contained in:
kepler155c@gmail.com
2017-08-05 04:17:06 -04:00
parent a1660fd073
commit c21afd2875
8 changed files with 34 additions and 47 deletions

View File

@@ -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, ...)

View File

@@ -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)

View File

@@ -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

View File

@@ -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)