Posted 23 July 2014 - 03:00 PM
Hello guys,
I was experimenting with the IO API and the FS API.
To save files i stared using a basic command:
Im using the HTTP API to receive a file form a cloud in the .nbs format (im not sure if im allowed to put the link here) and if I am saving the file (file handle) using the function up there ill lose some data and some letters are getting corrupted (before: ˇ after: � before: ¥e∑ô after: �e��).
Do I need to convert it to binary not to lose any data?
And is it possible to read line by line out of a file handle (file:seek function is missing)?
Thank your for taking the time to help me!
I was experimenting with the IO API and the FS API.
To save files i stared using a basic command:
function save(text,name)
local file = fs.open(name,"w")
file.write(text)
file.close()
end
So heres my problem:Im using the HTTP API to receive a file form a cloud in the .nbs format (im not sure if im allowed to put the link here) and if I am saving the file (file handle) using the function up there ill lose some data and some letters are getting corrupted (before: ˇ after: � before: ¥e∑ô after: �e��).
Do I need to convert it to binary not to lose any data?
And is it possible to read line by line out of a file handle (file:seek function is missing)?
Thank your for taking the time to help me!