add standard lua os methods, another fix for vfs links within links, allow write on urlfs mounted files

This commit is contained in:
kepler155c@gmail.com
2020-05-17 19:36:33 -06:00
parent c7c594d6c3
commit a7e3318226
7 changed files with 64 additions and 39 deletions

View File

@@ -5,15 +5,19 @@ local fs = _G.fs
local urlfs = { }
function urlfs.mount(_, url)
function urlfs.mount(path, url, force)
if not url then
error('URL is required')
end
return {
url = url,
created = os.epoch('utc'),
modification = os.epoch('utc'),
}
-- only mount if the file does not exist already
if not fs.exists(path) or force then
return {
url = url,
created = os.epoch('utc'),
modification = os.epoch('utc'),
}
end
end
function urlfs.attributes(node)
@@ -38,7 +42,7 @@ function urlfs.getSize(node)
end
function urlfs.isReadOnly()
return true
return false
end
function urlfs.isDir()