JDRenk 1 Posted November 1, 2022 How do I save binary data to a file with a fixed header? Like using APPEND for text. Share this post Link to post
aehimself 399 Posted November 1, 2022 Are you in control of both the data and the header? If yes, open the file for writing in your preferred method (AssignFile, TFiles, TFileStream) and write the header, then the data. If you get a file from an external source and you need to add a header, the easiest solution is a stream. Write your header and then copy the data from said file, loaded in a TFileStream. If you receive one header files and need to append data, all 3 methods (AssignFile, TFile, TFileStream) can append binary data to it. Share this post Link to post