Forum: Win32/Win64 API (native code)
Delphi
by himitsu,
2. Nov 2009
SetEndOfFile
To set the logical end of a file, use the SetFileValidData function.
ABER
Warning Use of this function without proper security considerations may compromise data privacy and security.
Forum: Win32/Win64 API (native code)
Delphi
by himitsu,
30. Okt 2009
Wenn du die Datei erstellst und via SetEndOfFile vergrößerst, dann wird sie erstmal mit 0 gefüllt.
Es kommt also in diesem Fall eigentlich besser du füllst die Datei direkt und weist ihr nicht vorher die Größe zu.
Du könntest jetzt, wenn die Datei garantiert nicht komprimiert wird (dieses legt ja Windows anhand des Ordners fest ... ist dieser komprimiert, dann wird die Datei auch),
dann...