[m-rev.] Refactoring make_temp

Paul Bone paul at bone.id.au
Thu May 26 16:21:33 AEST 2016


On Thu, May 26, 2016 at 03:26:51PM +1000, Julien Fischer wrote:
> 
> On Thu, 26 May 2016, Paul Bone wrote:
> 
> > 
> > I've been refactoring make_temp.  My goal is to make this code more
> > consistent between the Mercury backends by implementing most of it in
> > Mercury and only calling out to the foreign code for the system calls.  My
> > work in progress is here:
> > 
> >    https://github.com/PaulBone/mercury/tree/make_temp
> > 
> > I've removed the weird 5-character limit to the filename's prefix.  Suffixes
> > work properly in C grades (probably the bug the Julien experienced).
> 
> If your referring to the MinGW64 thing, the initial problem was you were
> adding another "." before the file extension, but that was a change to
> the Mercury compiler, not make_temp.  There's something else weird
> happening on that system which is, I think, unrelated to temporary
> files.  (I'm still looking at that latter one.)
> 

Yes, that's the one I was thinking of.  I suspect the problem may be that I
was using mkstemp and didn't know that it couldn't handle a suffix, I should
have been using mkstemps.  Sebastian pointed out my error for me.


-- 
Paul Bone


More information about the reviews mailing list