mjm461
April 28th, 2004, 12:56 PM
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...
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);
}
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);
}