Add mfs library
This commit is contained in:
parent
e49fed35eb
commit
d6516eaf40
22
mfs/lib/mfs.lua
Normal file
22
mfs/lib/mfs.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
local mfs={}
|
||||||
|
|
||||||
|
function mfs.read(x)
|
||||||
|
local f=fs.open(x,"r")
|
||||||
|
if not f then return nil end
|
||||||
|
local i=f.readAll()
|
||||||
|
f.close()
|
||||||
|
return i
|
||||||
|
end
|
||||||
|
|
||||||
|
function mfs.write(x,v)
|
||||||
|
local f=fs.open(x,"w")
|
||||||
|
f.write(v)
|
||||||
|
f.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
function mfs.mmkdir(x)
|
||||||
|
if not fs.exists(x) then
|
||||||
|
fs.makeDir(x)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
12
mfs/pkgmeta.ltn
Normal file
12
mfs/pkgmeta.ltn
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
["version"] = "0.1.0",
|
||||||
|
["dependencies"] = {
|
||||||
|
|
||||||
|
},
|
||||||
|
["description"] = "Has some semiconvinient fs commands for purposes.",
|
||||||
|
["files"] = {
|
||||||
|
["lib"] = {
|
||||||
|
"mfs.lua"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user