diff --git a/modules/lib/fs.lua b/modules/lib/fs.lua index d5cd39e..e8ddd0b 100644 --- a/modules/lib/fs.lua +++ b/modules/lib/fs.lua @@ -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