View Single Post
Old 2008-03-26, 23:00   #9
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

2·1,423 Posts
Default

to print all found primes in a seperate file (like Adams version) you can edit 'llrserver.lua' too.
the function 'WriteResultToFile' does such a thing (line 108):

Code:
function WriteResultToFile(job, filename)
   -- write result into lresults file
   local file = openfile(filename, "a")
   if file then
      write(file, format("user=%s\n", job.user))
      write(file, format("[%s]\n", job.resultdate))
      if job.result ~= "0" then
	 write(file, format(displayFormat.." is not prime.  Res64: %s  Time : %d.0 sec.\n", 
			    job.k, job.n, job.result, 
			    Seconds() - job.seconds))
      else
	 write(file, format(displayFormat.." is prime!  Time : %d.0 sec.\n", 
			    job.k, job.n, 
			    Seconds() - job.seconds))

         local fileprime = openfile("primes.txt", "a")
         if fileprime then
            write(fileprime, format("%s %s %s\n", job.k, job.n, job.user))
            closefile(fileprime)
         end


      end
      closefile(file)
   end
end
i couldn't check this if it works. try it.

karsten
kar_bon is offline   Reply With Quote