What does linux system errors, errno 21 mean

1.9k Views Asked by At

#define EISDIR 21 /* Is a directory */

"Is a directory" isn't very helpful when the place I get this error is from open(destination, O_WRONLY);

Of course it's a directory that's why im trying to open it...

1

There are 1 best solutions below

4
On BEST ANSWER

You cannot open directories for write mode (O_WRONLY), only read (O_RDONLY) or search (O_SEARCH). All modifications to directories take place through high level functions that either use a pathname or a file descriptor to the directory, but don't need it to be opened for write.

Here, EISDIR means "the operation you're trying to perform requires a non-directory, but you tried to perform it on a directory".