fix netfs issues - implement fs.attributes

This commit is contained in:
kepler155c@gmail.com
2020-04-27 15:44:09 -06:00
parent d72ae3de4a
commit e116caf16e
8 changed files with 78 additions and 52 deletions

View File

@@ -4,16 +4,20 @@ local linkfs = { }
-- TODO: implement broken links
local methods = { 'exists', 'getFreeSpace', 'getSize',
local methods = { 'exists', 'getFreeSpace', 'getSize', 'attributes',
'isDir', 'isReadOnly', 'list', 'listEx', 'makeDir', 'open', 'getDrive' }
for _,m in pairs(methods) do
linkfs[m] = function(node, dir, ...)
dir = dir:gsub(node.mountPoint, node.source, 1)
dir = linkfs.resolve(node, dir)
return fs[m](dir, ...)
end
end
function linkfs.resolve(node, dir)
return dir:gsub(node.mountPoint, node.source, 1)
end
function linkfs.mount(_, source)
if not source then
error('Source is required')