I really need a random file generator that creates really random, non-compressible files .
I ended up with this delphi code. It works, but it hurts 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 quick random file generator that I can use? Both Delphi codes and / or command line tools are acceptable if:
- I can run it on Windows without manual intervention (I need it for my tests, no intervention is allowed)
- quickly
- Generated files are not compressible (i.e., compression of the generated file does not require space saving)
EDIT . For those who are interested, I applied the advice I gave and made this function , it is fast enough and 7zip makes it difficult to compress the generated data.
source share