我想检索文件的大小,为此我以这种方式实现
(void)fseek(m_fp, 0, SEEK_END); // Set the file pointer to the end of the file
pFileSize = ftell(m_fp); // Get the file size
(void)fseek(m_fp, oldFilePos, SEEK_SET); // Put back the file pointer at the original location
这对于出于需要是不可行的,还有其他方法可以获取文件大小或检查文件是否包含数据