已解决问题 ... if (_access(pFileName, 0) != -1) // 判断文件是否存在 HANDLE hFile = CreateFile(pFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL); // 以只读方式打开文件 DWORD dwSize = GetFileSize(hFile, &dwLen); // 获取文件长度 ...
基于4个网页-相关网页
函数尝试使用错误的文件描述符(例如,它不引用打开的文件,或者用于尝试写入以只读方式打开的文件)。
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.
应用推荐