[m-dev.] EISDIR and file opening
Julien Fischer
jfischer at opturion.com
Sat Sep 3 04:25:49 AEST 2016
Hi Paul,
On Wed, 31 Aug 2016, Paul Bone wrote:
> I noticed recently that, at least on my Linux system, opening with fopen() a
> directory will succeed. Errors will be returned when you attempt to read
> from the returned file object.
>
> Should the library code check that it has not just opened a directory within
> the open code? Rather than waiting for the caller to attempt to read from
> the file?
All three non-C backends perform the check when an attempt to open file
is made and return an error if it is a directory. For consistency, this
should also be the (documented) behaviour of the C backends.
Julien.
More information about the developers
mailing list