[fpc-pascal] Random(), Randomize, and Linux permissions
F.Klaempfl at gmx.de
Wed Sep 29 08:49:22 CEST 2004
Alan Mead wrote:
> It's known that Randomize() is not effective when called rapidly... I
> tried to solve this using the code sample below. I can cat /dev/null
> (without becoming root) but when I run the code below I get an access
> denied RTE at 'Reset(f,1);'.. this code works fine when run as
/dev/random isn't effective either when called permanently. The entropy
pool of /dev/random is limited and /dev/random is a blocking device thus
it will block after several thousand calls. /dev/urandom doesn't block
but it's pseudo random as soon as /dev/random runs out of entropy.
> root... anyone have a suggestion?
Do a filemode:=0; before.
> procedure SuperRandomize;
> f: file of cardinal;
> Card: Cardinal;
> RandSeed := Card;
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal