größe von dateien sollte man per stat bzw. fstat ermitteln:
http://pubs.opengroup.org/onlinepubs...ons/fstat.html
http://pubs.opengroup.org/onlinepubs...ys/stat.h.html
also
Code:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
long filesize(FILE *stream) {
struct stat stat_buf;
int status;
status = fstat(stream, &stat_buf);
return status == 0 ? (long) stat_buf.st_size : status;
}
das ist C standard.
da gibt es bestimmt auch was c++-mäßiges, aber da bin ich nicht so eingearbeitet.