In the past, I saw this work, but I never understood how it should be done.
Suppose we have a file of known data types , but an unknown length , like a dynamic array TSomething, where
type
TSomething = class
Name: String;
Var1: Integer;
Var2: boolean;
end;
The problem is that this type of object can be expanded in the future by adding more variables (e.g. Var3: String).
Then, files saved with an older version will not contain the latest variables .
The file reading procedure must somehow recognize the data in blocks using an algorithm such as:
procedure Read(Path: String)
begin
// Read Array Size
// Read TSomething
//
end;
BlockRead BlockWrite, , , , , ( ), , .
, :
SO - Delphi 2010: ?
Delphi - BlockRead
SO - / - Delphi
SO - FileStream Delphi?