Append to a file?

*To*: mathgroup at smc.vnet.net*Subject*: [mg47522] Append to a file?*From*: Nathan Moore <nmoore at physics.umn.edu>*Date*: Thu, 15 Apr 2004 03:39:34 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

Suppose I have a really difficult calculation that I perform - a nested sum, For[ For[ something_really_hard,{i,0,20}], {j,0,50} ] where "something_really_hard" is a calculation that takes several minutes. Total execution time is going to be several hours, and I'd rather not have the calculation go most of the day and the fail at the last minute. Each execution of "something_really_hard" produces a vector of numbers as a result. I could of course store this vector as a list and then export it to file after the evaluation finishes, but I'd rather not risk losing that execution time. Is there an "Append-Export" command which I could use to append the state of my evaluation to the data file? The c programming corollary I'm thinking of is fflush()? I'm imagining Mathematica adding one line to the data file each time the inner for loop iterates. Nathan Moore University of Minnesota Physics