为什么ENOENT意味着“没有这样的文件或目录”?

本文翻译自:Why does ENOENT mean “No such file or directory”?

What is "ENT" short for? 什么是“耳鼻喉科”的缩写?

The error : error

should just be named by "ENOFILE". 应该只用“ENOFILE”命名。

Is there any story or reason? 有什么故事或理由吗?


#1楼

参考:https://stackoom.com/question/1LVdM/为什么ENOENT意味着-没有这样的文件或目录


#2楼

It's an abbreviation of Error NO ENTry (or Error NO ENTity), and can actually be used for more than files/directories. 它是Error NO ENTry(或Error NO ENTity)的缩写,实际上可以用于多个文件/目录。

It's abbreviated because C compilers at the dawn of time didn't support more than 8 characters in symbols. 它的缩写是因为C编译器在时间的早期不支持符号中超过8个字符。


#3楼

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. 由于目录条目可以是目录或文件(或符号链接,或套接字,或管道或设备),因此名称ENOFILE的含义过于狭窄。

本文链接:https://my.lmcjl.com/post/943.html

展开阅读全文

4 评论

留下您的评论.