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

@@ -9,15 +9,28 @@ function ramfs.mount(_, nodeType)
return {
nodes = { },
size = 0,
created = os.epoch('utc'),
modification = os.epoch('utc'),
}
elseif nodeType == 'file' then
return {
size = 0,
created = os.epoch('utc'),
modification = os.epoch('utc'),
}
end
error('ramfs syntax: [directory, file]')
end
function ramfs.attributes(node)
return {
created = node.created,
isDir = not not node.nodes,
modification = node.modification,
size = node.size,
}
end
function ramfs.delete(node, dir)
if node.mountPoint == dir then
fs.unmount(node.mountPoint)