integer FP;
integer fgetsResult;
integer sscanfResult;
integer NowInSeconds;
reg [8*10:1] str;
// call "date" and put out time in seconds since Jan 1, 1970 (when time began, no doubt)
// and put the results in a file called "now_in_seconds"
$system("date +%s > now_in_seconds");
// open the file for reading
FP = $fopen("now_in_seconds","r");
// get a string from the open file - "fgetsResult" should be a 1 - you can test
// that for completeness if you'd like
fgetsResult = $fgets(str,FP);
// convert the string to an integer - "sscanfResult" should also be a 1, and
// you can test that, too,
sscanfResult = $sscanf(str,"%d",NowInSeconds);
// close the file...
$fclose(FP); // closes the file
// use the number as a seed...
process::self.srandom(NowInSeconds);