cp may work properly on large files now, previous method was a horrid hack
This commit is contained in:
parent
a6e6bb5f6b
commit
e1f8f6697e
@ -237,7 +237,12 @@ function fs.cp(s,d)
|
||||
local df = fs.open(d,"wb")
|
||||
local sf = fs.open(s,"rb")
|
||||
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(sf)
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user