Get the file size with C Runtime Library

xiaoxiao2021-03-06  104

Long getFilesize (const char * filename) {file * fp; long lret; if (fp = fopen (filename, "r")) == null) Return 0; FSeek (fp, 0, seek_ek_end); LRET = FTELL FP); fclose (fp); return lret;

Code description:

FileName: File path.

Return Value: Returns the file size if success, otherwise returns zero.

转载请注明原文地址:https://www.9cbs.com/read-102239.html

New Post(0)