number of characters to read next. I'm probably overlooking something
so simple, but I can't seem to figure out what it is. Here is my code
Code: Select all
sfile = io.open(infile,"r")
numchar = sfile:read(1)
dataout = sfile:read(tonumber(numchar))
the first value is (for my testing purposes) a byte value of 9 followed by
9 characters that represent a file name.
I'm stuck until I can figure this out, so any help is greatly appreciated.
EDIT*
It was something obvious and I got it fixed.
Code: Select all
sfile = io.open(infile,"r")
numchar = string.byte(sfile:read(1))
dataout = sfile:read(numchar)