Should -ddump-to-file append or overwrite?
Edward Z. Yang
ezyang at MIT.EDU
Tue May 24 16:08:35 CEST 2011
A bit late sending this update, but -ddump-to-file overwrites now.
Edward
Excerpts from Edward Z. Yang's message of Sun May 15 06:55:44 -0400 2011:
> It looks like it's in IO now, so I added an IORef to keep track of what files we've
> seen and truncate on the first write. I'll push the change soon.
>
> Cheers,
> Edward
>
> Excerpts from Ben Lippmeier's message of Sun May 15 04:35:31 -0400 2011:
> >
> > On 14/05/2011, at 11:16 PM, Edward Z. Yang wrote:
> >
> > > Currently, -ddump-to-file appends to an existing file. This is pretty confusing
> > > for me, if I wanted to get a new set of information, because now I have to delete
> > > any dump files before I take more data, or I need to manually separate out the
> > > runs (which, by the way, are not demarcated.)
> > >
> > > If no one else objects, I'll flip this to overwriting previous files, much the
> > > same way other things we dump to files work.
> >
> >
> > I added the -ddump-to-file flag a few years ago, but I remember having trouble finding a place to delete any existing dump file. My recollection is that some of the --dump-to-file functionality is an unsafePerformIO'd hook on the pretty printer, so there were sequencing issues when writing out the files. I agree it'd be nicer to have separate files, but at the time I couldn't work a simple, clean way of implementing them.
> >
> > Ben.
More information about the Cvs-ghc
mailing list