diff --git a/modules.cfg b/modules.cfg index db0eff6..d5f6ac5 100644 --- a/modules.cfg +++ b/modules.cfg @@ -5,6 +5,7 @@ drivers/keyboard.lua library/net.lua library/fs-min.lua library/fs-std.lua +library/fs-ext.lua util/fs-automount.lua applications/shutil.lua applications/luash.lua diff --git a/modules/library/fs-ext.lua b/modules/library/fs-ext.lua new file mode 100644 index 0000000..bd300c1 --- /dev/null +++ b/modules/library/fs-ext.lua @@ -0,0 +1,12 @@ +function flist(s) + local d,p = fres(s) + return d.list(p or "/") +end +function fmkdir(s) + local d,p = fres(s) + return d.makeDirectory(p or "/") +end +function frm(s) + local d,p = fres(s) + return d.remove(p) +end diff --git a/modules/library/fs-min.lua b/modules/library/fs-min.lua index f717d35..140194d 100644 --- a/modules/library/fs-min.lua +++ b/modules/library/fs-min.lua @@ -1,6 +1,6 @@ fT = {} function fres(p) - local fid = (p:match("(%a-):.+") or p:match("/?(%a-)/.+")) + local fid = (p:match("(%a-):") or p:match("/?(%a-)/")) local pt = (p:match("%a-:(.+)") or p:match("/?%a-/(.+)")) - if fT[fid] ~= nil and pt ~= nil then return fT[fid],pt else return false end + if fT[fid] ~= nil then return fT[fid],pt else return false end end