Answer the question
In order to leave comments, you need to log in
Write to a file starting at a certain position?
Um, ... strange, but. In general, there is a code fragment, and it does not work, I don’t know why, but I need it to work.
file = io.open(exepath, "a+b")
local fsz = file:seek"end"
print(fsz, datablc)
file:seek("set", math.min(fsz, datablc))
file : write("THE TEST POSITIONED DATA!")
file : close()
Answer the question
In order to leave comments, you need to log in
Changed the file open mode to r+b and it worked. Now the question is different, how to erase, i.e. delete a fragment from a file in the same mode?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question