2013年5月2日 星期四

[C]取得檔案大小


FILE *fp=BULL;
if ((fp = fopen(filename, "r")) == NULL) {
fprintf(stderr, "fopen '%s' error: %s (errno %d)\n", filename, strerror(errno), errno);
}

fseek(fp, 0, SEEK_END);
len = ftell(fp);