Ticket #104 (closed defect: fixed)

Opened 1 month ago

Last modified 1 month ago

write method of the Recorder class doesn't overwrite old data

Reported by: jie.bao@gmail.com Assigned to: apdavison
Priority: minor Milestone: Release 0.5.0
Component: nest2 Version: trunk
Keywords: print, recorder, write Cc:

Description

the write method of the Recorder class concatenates the data to the old file rather than overwritting it, see nest2/init.py line 171:

system_line = 'cat %s >> %s' % (nest_filename, user_filename)

I checked the implementation in the older version, there was actually a line at the beginning of print function, which removes the old files. I'm not sure if the current implementation is desirable, can someone confirm this?

Change History

07/15/08 12:54:26 changed by apdavison

  • priority changed from major to minor.
  • status changed from new to closed.
  • version set to trunk.
  • resolution set to fixed.
  • milestone set to Release 0.5.0.

The current implementation does not seem to be desirable, so I have changed it (r412) to overwrite an existing file rather than append to it, although arguably we should really raise an Exception if the file already exists - see #51.