Subj : Re: newbie question [C language] To : comp.programming From : Peter Nilsson Date : Wed Jul 06 2005 11:56 pm Randy Howard wrote: > osmium wrote: > > "Fred_NacH" writes: > >> I was wondering, how to retrieve the size/length of a file by only using > >> the ansi functions... > > > > This one often causes a lot of controversy, some people say there is a > > (usually unnamed) system on which it won't work or at least there *could > > have been* a system on which it wouldn't work if such a system had been > > built. > > > > Open the file in *binary* mode, seek to end of file, and use ftell() to see > > where you are. If you like acrimony and pedantry, look around on Usenet for > > these discussions which flare up from time to time. > > I wonder if you have ever tried it on fat binaries under OS X. > I suspect not. I haven't used an OS X based mac, but in system 7 days, fopen() on most C implementations would only open the data fork, irrespective of whether it was binary or not. So I think you're talking about a different issue relating to fopen, rather than ftell. -- Peter .