Danke für die Idee! Geht schon deutlich schneller.
Mein "Kot"
Delphi-Quellcode:
iFileSizeToWrite := 15728640;
// 15 MB
aFileStream := TFileStream.Create('
C:\test.txt', fmCreate
or fmOpenWrite);
try
iBytesCounter := 0;
repeat
sTmp := '
';
for j := 1
to (1024 * 1024)
do // 1 MB pro Durchgang
begin
sTmp := sTmp + '
X';
Dec(iFileSizeToWrite);
if iFileSizeToWrite = 0
then
Break;
end;
aFileStream.
Write(PChar(sTmp)^, Length(sTmp));
until iFileSizeToWrite = 0;
finally
aFileStream.Free;
end;
Ob das noch schneller ginge?