SHARE
TWEET

Untitled

a guest May 6th, 2012 27 Never
  1. Lua: Prevent carriage return in binary code
  2. file=io.open(filepath,'rb')
  3. file:seek("set")
  4. file:seek("cur",startoffset)
  5. filecontent=file:read(endoffset-startoffset)
  6. io.output(test.tmp)
  7. io.write(filecontent)
  8.        
  9. local file = assert(io.open(filepath, "rb"), "Could not open file for reading.")
  10. local filecontent = file:read("*a")
  11. file:close()
  12. file = assert(io.open("temp.tmp", "wb"),  "Could not open file for writing.")
  13. file:write(filecontent)
  14. file:close()
RAW Paste Data
Top