[fpc-pascal] Random(), Randomize, and Linux permissions

Alan Mead cubrewer at yahoo.com
Wed Sep 29 08:36:43 CEST 2004


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
root... anyone have a suggestion? 

-Alan

  procedure SuperRandomize;
    var
      f: file of cardinal;
      Card: Cardinal;
    begin
        Assign(f,'/dev/random');
        Reset(f,1);
        read(f,Card);
        RandSeed := Card;
        close(f);
    end;




More information about the fpc-pascal mailing list