> I want to save the current statistics to the stats.txt file every x cycles. > I managed that this is done in a way that the new values are attached to the > stats.txt file, meaning that every x cycles a new passage beginning with > "---------- Begin Simulation Statistics ----------" and ending with > "---------- End Simulation Statistics ----------" is attached to the output > file. My wish is that only the new and actual values can be found in the > file. So I want to clear/reset the stats.txt before dumping the new > statistics. I tried to simple delete the file and create a new and empty one > before saving the statistics but this doesn't work (in this case the file > stays empty). Has anyone an idea how to solve this problem?
This is because the file descriptor continues to point to the deleted file. What you could try to do instead is truncate the file using the truncate command. Alternatively, you can just hack the code to seek to the beginning and truncate the file. One issue is that I'm not sure if we open the file for append, so you may have to hack the code anyway. Nate _______________________________________________ m5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
