Hi
I have a program that goes through a directory and finds files. When it finds certain ones, I need it to read the first 65 bytes of their header and then "do stuff" with the values found in the header.
I've learnt in IRC from Laksen that file streams are the way to do this and he kindly got me on the right track so that my app does read in the header of a file :
procedure TForm1.ProbeFile(FileIterator: TFileIterator);
type
TMyHeader = packed record
SomeBytes,
SomeMoreBytes,
NextBytes: byte;
end;
var
FileToProbe: TStream;
header: TMyHeader;
// Now open the file and read the header
FileToProbe := TFileStream.Create(FileIterator.FileName, fmOpenRead);
FileToProbe.ReadBuffer(header, SizeOf(header));
// Now show the user the content of the header, once you get it working!!!
FileToProbe.Free;
So how do I "convert" what FileToProbe.ReadBuffer(header, SizeOf(header)); has done into something I can display in a memo box or something? I am struggling understanding what I actually have in memory at this stage.
Thanks
Ted