I badly need a random file generator that generates a truly random, non-compressible dummy files.
I ended up with this delphi code. It works, but it's painfully sloooow
var
Buf : Integer;
TheFile : TFileStream;
begin
TheFile := TFileStream.Create(FileName, fmCreate OR fmOpenReadWrite);
with TheFile do
begin
for i := 0 to FileSize do // Iterate
begin
Buf := Random(999999) * i;
WriteBuffer(Buf, SizeOf(Buf));
end; // for
end; // with
end,
My question is: Is there a fast random file generator that I can use? Both Delphi code and/or commandline tools are acceptable as long as:
EDIT For those interested, I applied the advice I received here and made this function, it's fast enough & 7zip has hard time compressing the generated data.
Use a 4096-byte page-size, or multiple page-size, buffer. Writing one integer at a time will be slow.