store errno in SIMPLE-FILE-ERROR conditions#442
store errno in SIMPLE-FILE-ERROR conditions#442galdor wants to merge 1 commit intoClozure:masterfrom
Conversation
CCL signals SIMPLE-FILE-ERROR conditions for all file-related errors, but they do not contain any information to programmatically distinguish what the error actually is. The most basic use case is the ability to detect that opening a file failed because it does not exist. Without this patch, it is impossible to make the difference between a file-not-found error and for example an IO error.
1f276c7 to
75b2e35
Compare
|
Btw I just realized that |
|
#364 may also be in this area |
|
Indeed, it seems useful. But there is not much I can do about it, I do not have write access ;) |
|
I hate to discourage this, but it feels to me that this (expose errno in simple-file-error) is not the right way to go. You said that you really wanted a |
|
That would be better indeed; but in that case, I would simply ignore |
CCL signals SIMPLE-FILE-ERROR conditions for all file-related errors, but they do not contain any information to programmatically distinguish what the error actually is.
The most basic use case is the ability to detect that opening a file failed because it did not exist. Without this patch, it is impossible to make the difference between a file-not-found error and, for example, an IO error.
I originally wanted to introduced a new
FILE-DOES-NOT-EXISTcondition inheriting fromSIMPLE-FILE-ERRORas SBCL does withSB-EXT:FILE-DOES-NOT-EXIST, but this would require seriously reworking the whole%ERR-DISP-COMMONthing, and I honestly have no idea where to start. Storing errno into the file error makes sense. Even if it is very low level, it provides the necessary information so that a caller can decide how to handle it, without changing any existing API.