Advertisement
Guest User

Untitled

a guest
May 6th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement