Re: Why doesn't (open ... :if-exists) support :truncate?
- From: David Lichteblau <usenet-2006@xxxxxxxxxxxxxx>
- Date: 30 Nov 2007 18:13:00 GMT
On 2007-11-30, Richard M Kreuter <kreuter@xxxxxxxxx> wrote:
Well, the CLHS entry for OPEN says that when :IF-EXISTS is :SUPERSEDE,
"a new file with the same name as the old one is created". ISTM that
there's some difference between truncating a file and replacing one
file with another (using something like POSIX rename(), say):
Indeed. I was quite stumped when my SBCL heap got corrupted while
writing new files using :SUPERSEDE -- I had those files mmap()ed into
dynamic space... :-) Of course, it is useful to have an
implementation-specific way to do O_TRUNC integrated into OPEN, but
:SUPERSEDE should not be it.
SBCL's :APPEND has a similar bug. The spec says "The file pointer is
initially positioned at the end of the file", but SBCL maps it to
O_APPEND instead.
d.
.
- Follow-Ups:
- Re: Why doesn't (open ... :if-exists) support :truncate?
- From: Richard M Kreuter
- Re: Why doesn't (open ... :if-exists) support :truncate?
- References:
- Why doesn't (open ... :if-exists) support :truncate?
- From: Richard M Kreuter
- Re: Why doesn't (open ... :if-exists) support :truncate?
- From: Steven M. Haflich
- Re: Why doesn't (open ... :if-exists) support :truncate?
- From: Richard M Kreuter
- Why doesn't (open ... :if-exists) support :truncate?
- Prev by Date: Re: Reasons to choose CLISP over other free implementations
- Next by Date: Re: Why doesn't (open ... :if-exists) support :truncate?
- Previous by thread: Re: Why doesn't (open ... :if-exists) support :truncate?
- Next by thread: Re: Why doesn't (open ... :if-exists) support :truncate?
- Index(es):