made fs.cp fail if either handle fails to open. ???
This commit is contained in:
parent
599f685b8c
commit
faac6621a5
@ -236,9 +236,13 @@ end
|
|||||||
function fs.cp(s,d)
|
function fs.cp(s,d)
|
||||||
local df = fs.open(d,"wb")
|
local df = fs.open(d,"wb")
|
||||||
local sf = fs.open(s,"rb")
|
local sf = fs.open(s,"rb")
|
||||||
|
if df and sf then
|
||||||
fs.write(df,fs.readall(sf))
|
fs.write(df,fs.readall(sf))
|
||||||
fs.close(df)
|
fs.close(df)
|
||||||
fs.close(sf)
|
fs.close(sf)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
function fs.mv(s,d)
|
function fs.mv(s,d)
|
||||||
fs.cp(s,d)
|
fs.cp(s,d)
|
||||||
|
Loading…
Reference in New Issue
Block a user