1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-12-24 09:58:06 +11:00
Zorya-NEO/mods/io/init.lua

45 lines
991 B
Lua
Raw Normal View History

2020-03-13 08:01:05 +11:00
local vfs = krequire("zorya").loadmod("vfs")
local io = {}
local hand = {}
local hands = {}
function io.open(path, mode)
2020-12-21 16:14:39 +11:00
local proxy, path = vfs.resolve(path)
if not proxy then return nil, "file not found" end
2020-03-13 08:01:05 +11:00
end
function io.remove(path)
2020-12-21 16:14:39 +11:00
local proxy, path = vfs.resolve(path)
if not proxy then return false end
return proxy.remove(path)
2020-03-13 08:01:05 +11:00
end
function io.mkdir(path)
2020-12-21 16:14:39 +11:00
local proxy, path = vfs.resolve(path)
if not proxy then return false end
return proxy.makeDirectory(path)
2020-03-13 08:01:05 +11:00
end
function io.move(path, newpath)
2020-12-21 16:14:39 +11:00
local proxy1, path1 = vfs.resolve(path)
local proxy2, path2 = vfs.resolve(path)
if not proxy1 or not proxy2 then return false end
if proxy1 == proxy2 then
proxy1.rename(path1, path2)
end
2020-03-13 08:01:05 +11:00
end
function io.isreadonly(path)
2020-12-21 16:14:39 +11:00
local proxy = vfs.resolve(path)
if not proxy then return false end
return proxy.isReadOnly()
2020-03-13 08:01:05 +11:00
end
function io.exists(path)
2020-12-21 16:14:39 +11:00
local proxy, path = vfs.resolve(path)
if not proxy then return false end
return proxy.exists(path)
2020-03-13 08:01:05 +11:00
end
return io