On Sat, Nov 07, 1998 at 05:11:55PM +0200, Leon Breedt wrote:
> hi again
>
> is there a function similar to pascal's filesize() in ANSI C? something
> that will take a pointer to a stream as parameter, and return the file
> size in bytes.
you can use stat. it takes the name of the file.... fstat will take a file
descriptor... so if you get the file descriptor of the stream you are in
buisness. the member of the structure you want is st_size. eg.
struct stat st;
.
.
/* stat the file... */
.
.
printf("file size is %d\n", st.st_size);