Why does ENOENT mean "No such file or directory"?

CLinuxUnix

C Problem Overview


What does the ENT mean in ENOENT?

Shouldn't the error:

> No such file or directory

just be named by ENOFILE?

Is there any story or reason?

C Solutions


Solution 1 - C

It's an abbreviation of Error NO ENTry (or Error NO ENTity), and can actually be used for more than files/directories.

It's abbreviated because C compilers at the dawn of time didn't support more than 8 characters in symbols.

Solution 2 - C

It's simply “No such directory entry”. Since directory entries can be directories or files (or symlinks, or sockets, or pipes, or devices), the name ENOFILE would have been too narrow in its meaning.

Solution 3 - C

For a full list of all the codes and a better description of what each one means see errno.h This is an include file that is part of the C standard library and the comments clarify what the error is about. In this case: > #define ENOENT 2 /* No such file or directory */

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmingchaoyanView Question on Stackoverflow
Solution 1 - CSome programmer dudeView Answer on Stackoverflow
Solution 2 - CRoland IlligView Answer on Stackoverflow
Solution 3 - CDrorView Answer on Stackoverflow