Date: Wed, 5 May 1993 09:37:54 -0700 (PDT) From: Andrew Tucker Subject: Re: djgpp(gcc) equivalents to some bcc/tcc functions To: "Wonkoo Kim, EE, U. of Pittsburgh" Cc: djgpp AT sun DOT soe DOT clarkson DOT EDU On Wed, 5 May 1993, Wonkoo Kim, EE, U. of Pittsburgh wrote: > filelength() determine the file size This is probably the easiest to implement: long filelength(FILE *fp) { long orig, size; orig = tell(fp); fseek(fp, 0L, SEEK_SET); size = fseek(fp, 0L, SEEK_END); fseek(fp, orig, SEEK_SET); return(size); } This will work on any ANSI C compiler and, of course, preserves the original position of the file pointer. You could write a similar routine for file handles if need be. /* Andrew */ "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality" Albert Einstein