Jeff King <peff@xxxxxxxx> writes: > I don't know that this is really consistent with callers of fopen(), > since they tend to complain noisily. Usually via warn_on_fopen_errors(), > which we ourselves call above. Argh, you're right. I thought the guard in warn_on_fopen_errors() would catch the artificial error code we give when we found that we opened a directory (by mistake), but the error we use is EISDIR, so it will be shown. OK, let's scrap the whole thing. It does not look like it is solving any real-world problems. Thanks.