From: Nikodemus S. <nik...@ra...> - 2008-02-21 18:21:07
|
On 2/21/08, Richard M Kreuter <kr...@pr...> wrote: > CreateFile()). So I'd rather have OPEN take the extra arguments in some > way; I thought requiring :ALLOW-OTHER-KEYS was a reasonable compromise > between strictness and whatnot. If you're not now opposed to adding > keywords to OPEN's lambda list, I'll just do that (and add to the > docstring that these keywords are extensions). Quite frankly, I'm not sure what I think re new keywords. On one hand, it is convenient, simple, etc. On the other, it does't really jump out from the source as "this is unportable!". Using 'SB-EXT:FOO instead of :FOO would take care of that, but if we have vague hopes of other implementations adopting these things, then... Right _now_ _I_ think adding things like :TRUNCATE is ok, but I don't expect everyone to agree -- especially since I'm not sure I though so last month... One thing I do have a pretty solid stance on, though, is that :ALLOW-OTHER-KEYS should not magic functionality into being. While nothing prohibits it, and it seems definitely conforming, it also seems just... horrible. If :FOO T signals an error without :ALLOW-OTHER-KEYS T, adding that should just make the error go away, not add new behaviour. (When I mentioned that possibility, I didn't mean it quite seriously -- sorry for the confusion.) > If new files get created under their final names, then in this sequence > process-1 will delete the file process-2 created; but process-2's output > file isn't the file associated with *S*. So while it's slightly strange > at first blush, to avoid having an aborting CLOSE delete the wrong file > in general [*], new files should be created under random names even when > no file with the final name already exists. (This is why I mention > issues about world-writable directories in my writeup. We can get into > this in more detail, if you like.) ...but then we get another set of problems: Thread 1: (with-open-file (f "foo" :direction :output :if-exists :error) ...) Thread 2: (with-open-file (f "foo" :direction :output :if-exists nil) ...) Both threads will think they managed to create the file, though in reality only one did. This becomes especially nasty for core trying to use some sort of mostly-portable temporary file creation scheme. Files and streams are hard, let's go shopping... Cheers, -- Nikodemus |