added fs.cp and fs.mv for copying amd moving files.

This commit is contained in:
Izaya 2017-08-31 12:31:54 +10:00
parent 8e7b96ae08
commit fca81639fa
1 changed files with 11 additions and 0 deletions

View File

@ -121,3 +121,14 @@ function fs.cd(p)
error("non-existent/not a dir")
end
end
function fs.cp(s,d)
local df = fs.open(d,"wb")
local sf = fs.open(s,"rb")
fs.write(df,fs.readall(sf))
fs.close(df)
fs.close(sf)
end
function fs.mv(s,d)
fs.cp(s,d)
fs.rm(s)
end