Im seeing g++ does not have a filelength function like Borland? So I wrote my own. My function always seems to return 5 greater than the value I need...
Code:
long filelength(int fd)
{
    long pos = lseek(fd, 0, SEEK_CUR);
    long end = lseek(fd, 0, SEEK_END);
    lseek(fd, pos, SEEK_SET);
    return (end);
}