Bo Berglund
2018-10-14 13:40:16 UTC
It seems like I cannot use Append() on a file of byte.
Neither is it allowed to use SeekEOF() on that file type...
I want to log binary data to a logfile and therefore I need to open it
for writing with record size =1 and the file pointer at the eof
location.
But all of the useful functions seem only to work with text files.
What do I use to append binary data to an existing binary file?
This throws an error at SeekEof:
AssignFile(F, FileName);
if AppendToFile then
SeekEof(F)
else
Rewrite(F,1);
BlockWrite(F, Buf[0], Length(Buf));
CloseFile(F);
Neither is it allowed to use SeekEOF() on that file type...
I want to log binary data to a logfile and therefore I need to open it
for writing with record size =1 and the file pointer at the eof
location.
But all of the useful functions seem only to work with text files.
What do I use to append binary data to an existing binary file?
This throws an error at SeekEof:
AssignFile(F, FileName);
if AppendToFile then
SeekEof(F)
else
Rewrite(F,1);
BlockWrite(F, Buf[0], Length(Buf));
CloseFile(F);
--
Bo Berglund
Developer in Sweden
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.or
Bo Berglund
Developer in Sweden
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.or