added fs.cp and fs.mv for copying amd moving files.
This commit is contained in:
parent
8e7b96ae08
commit
fca81639fa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user