From: jsc AT lds DOT co DOT uk Newsgroups: comp.os.msdos.djgpp Subject: length of file (baffling me) Date: Sat, 14 Aug 1999 14:25:08 GMT Organization: Deja.com - Share what you know. Learn what you don't. Lines: 29 Message-ID: <7p3u7u$ncb$1@nnrp1.deja.com> NNTP-Posting-Host: 194.73.88.175 X-Article-Creation-Date: Sat Aug 14 14:25:08 1999 GMT X-Http-User-Agent: Mozilla/2.0 (compatible; MSIE 3.0; Windows 95) X-Http-Proxy: 1.0 x35.deja.com:80 (Squid/1.1.22) for client 194.73.88.175 X-MyDeja-Info: XMYDJUIDbillynomates To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello all, this must be an easy question, but I can't seem to get it to work. All I'm trying to do is work out the length of a file. I use FILE *fp; fp = fopen(filename, "rb"); where filename is just the argument in the function. And I can acces the bytes perfectly well, so I know I'm accessing the file correctly. but then when I try... printf( "File length: %i", filelength((int)fp) ); I get -1 returned, indicating an error, but I can't see why. If anyone could help, I'd really appreciate it. Thanks a lot, Christopher -- Christopher Anthony, Goldfish Style Council jsc AT lds DOT co DOT uk http://members.xoom.com/Billynomates/chris.html > > > Don't follow your dreams - chase them! Hunt them down! Grab on tight and never let go!!!! :) -Dr. Noitamina Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.