[m-rev.] io.m latest full diff
Ralph Becket
rafe at cs.mu.OZ.AU
Thu Jan 22 12:06:20 AEDT 2004
Fergus Henderson, Thursday, 22 January 2004:
> On 22-Jan-2004, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > > % io__make_temp(Name, IO0, IO) creates an empty file
> > > % whose name which is different to the name of any existing file.
> > > [...]
> >
> > I'm slightly worried about the interface to this predicate: can't the
> > operation fail? Or do we worry about that when we try to open it?
>
> Yes, the operation can fail, but only in exceptional circumstances
> (e.g. disk full), and in such cases, we throw an exception.
I thought the IO library reported errors via error codes? Personally,
I'd rather have just one idiom for this sort of thing.
> > Another issue is whether it should actually open the file for us. Is it
> > guaranteed that you can open a file immediately after creating it or is
> > there a race condition on some OSs?
>
> To the best of my knowledge, it should be possible to open a file
> immediately after creating it on any OS. I don't see why any OS
> would have a problem with that.
Well, I've had all sorts of fun with shell scripts not working properly
because of assumptions like that, but... we can fix the problem later if
it ever arises.
-- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list