mirror of
https://github.com/Adorable-Catgirl/Zorya-NEO.git
synced 2024-11-27 04:38:06 +11:00
CPIO fixes, readmes
This commit is contained in:
parent
25779bd202
commit
116a35786e
@ -3,6 +3,8 @@ local arcfs = {}
|
|||||||
function arcfs.make(arc)
|
function arcfs.make(arc)
|
||||||
local proxy = {}
|
local proxy = {}
|
||||||
local function ni()return nil, "not implemented"end
|
local function ni()return nil, "not implemented"end
|
||||||
|
proxy.remove = ni
|
||||||
|
proxy.makeDirectory = ni
|
||||||
function proxy.exists(path)
|
function proxy.exists(path)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -70,13 +70,29 @@ function arc:fetch(path)
|
|||||||
return nil, "file not found"
|
return nil, "file not found"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function arc:exists(path)
|
||||||
|
for i=1, #self.tbl do
|
||||||
|
if (self.tbl[i].name == path) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
function arc:close()
|
function arc:close()
|
||||||
self.fs.close(self.handle)
|
self.fs.close(self.handle)
|
||||||
self.tbl = {}
|
self.tbl = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
function arc:list_dir(path)
|
function arc:list_dir(path)
|
||||||
--soon:tm:
|
if path:sub(#path) ~= "/" then path = path .. "/" end
|
||||||
|
local ent = {}
|
||||||
|
for i=1, #self.tbl do
|
||||||
|
if (self.tbl[i].name:sub(1, #path) == path and not self.tbl[i].name:find("/", #path+1, false)) then
|
||||||
|
ent[#ent+1] = self.tbl[i].name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ent
|
||||||
end
|
end
|
||||||
|
|
||||||
return cpio
|
return cpio
|
@ -268,6 +268,11 @@ function arc:fetch(path)
|
|||||||
return self.fs.read(self.h, obj.size)
|
return self.fs.read(self.h, obj.size)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function arc:exists(path)
|
||||||
|
local obj = path_to_obj(path)
|
||||||
|
return obj.type ~= "eoh"
|
||||||
|
end
|
||||||
|
|
||||||
function arc:close()
|
function arc:close()
|
||||||
self.cache = nil
|
self.cache = nil
|
||||||
self.fs.close(self.h)
|
self.fs.close(self.h)
|
||||||
|
7
mods/io/README.md
Normal file
7
mods/io/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# io module (Incomplete)
|
||||||
|
The IO module provides a PUC Lua-compatible I/O library.
|
||||||
|
|
||||||
|
## Additions from PUC Lua
|
||||||
|
* `io.mkdir(path)` - Makes a directory
|
||||||
|
* `io.isreadonly(path)` - Returns if path is read only
|
||||||
|
* `io.exists(path)` - Returns if path exists
|
@ -18,10 +18,11 @@ function fuchas:boot()
|
|||||||
while true do if computer.pullSignal() == "fuchas_dead" then break end end
|
while true do if computer.pullSignal() == "fuchas_dead" then break end end
|
||||||
end
|
end
|
||||||
|
|
||||||
return function(addr, args)
|
return function(addr)
|
||||||
--oefi.getExtensions().ZyNeo_ExecOEFIApp(addr, ".efi/fuchas.efi2", ...)
|
--oefi.getExtensions().ZyNeo_ExecOEFIApp(addr, ".efi/fuchas.efi2", ...)
|
||||||
--We don't do that here.
|
--We don't do that here.
|
||||||
local fuch = {}
|
local fuch = {}
|
||||||
|
fuch.args = {}
|
||||||
fuch.env = oefi.getExtensions().ZyNeo_GetOEFIEnv(addr)
|
fuch.env = oefi.getExtensions().ZyNeo_GetOEFIEnv(addr)
|
||||||
fuch.env.computer.supportsOEFI = function()
|
fuch.env.computer.supportsOEFI = function()
|
||||||
return true
|
return true
|
||||||
|
9
mods/loader_fuchas/readme.md
Normal file
9
mods/loader_fuchas/readme.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Fuchas laoder
|
||||||
|
This module provides a loader for the Fuchas operating system.
|
||||||
|
|
||||||
|
# Example usage
|
||||||
|
```lua
|
||||||
|
local fuch = loadmod("loader_fuchas")(address)
|
||||||
|
fuch:karg("key", "value")
|
||||||
|
fuch:boot()
|
||||||
|
```
|
@ -0,0 +1 @@
|
|||||||
|
-- lmao
|
Loading…
Reference in New Issue
Block a user