cp may work properly on large files now, previous method was a horrid hack
This commit is contained in:
parent
b04d700f94
commit
3774580806
@ -237,7 +237,12 @@ 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
|
if df and sf then
|
||||||
fs.write(df,fs.readall(sf))
|
local c = ""
|
||||||
|
while true do
|
||||||
|
c=fs.read(sf,2048)
|
||||||
|
if not c then break end
|
||||||
|
fs.write(df,c)
|
||||||
|
end
|
||||||
fs.close(df)
|
fs.close(df)
|
||||||
fs.close(sf)
|
fs.close(sf)
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user