[physfs] [semi-OT] stdio question

Adam D. Moss adam at gimp.org
Sat Dec 20 12:52:28 EST 2003


Brian Hook wrote:
>>I was wondering whether there's a way (ideally ANSI C) to get the
>>size of an already-open FILE*.  
> 
> Use fseek(SEEK_END) then ftell()

Ah, cool.  Thanks, should have thought of that, since I'm
using the same trick in reverse on the PhysicsFS side to
implement fseek(..SEEK_END)!  Unfortunate that it causes a seek
though -- have to reset the cursor again afterwards.  Hopefully
the seek doesn't physically occur anyway.

Thanks,
--Adam
-- 
Adam D. Moss   . ,,^^   adam at gimp.org   http://www.foxbox.org/   co:3



More information about the physfs mailing list