函数尝试使用错误的文件描述符(例如,它不引用打开的文件,或者用于尝试写入以只读方式打开的文件)。
EBADF -- A function tried to use a bad file descriptor (it doesn't refer to an open file, for example, or it was used in an attempt to write to a file that was opened read-only).
注:fopen中使用的“r ”将指示文件以只读方式打开。
Note: the "r" used in fopen indicates that the file is open for reading only.
以只读方式打开,放置在文件开头的文件指针。
Open for reading only; place the file pointer at the beginning of the file.
以只读方式打开,放置在文件开头的文件指针。
Open for reading only; place the file pointer at the beginning of the file.
应用推荐