PHYSFS_seek/tell with buffered data

Tree tree at stain.org
Tue Jan 28 10:25:02 EST 2003


Hello,

I've just been stuffing PhysFS into OpenSceneGraph (www.openscenegraph.org) file handling mechanism as I'm using archives. When I tested my code using the default initialisation I had PHYSFS_tell lying to me about it's current location in the file after a seek. I noticed that the buffer values don't get reset in PHYSFS_seek, so bufpos is the same as for the last read, this seems wrong to me. I added the line:

if(h->buffer != NULL)
    h->buffill = h->bufpos = h->bufsize;

just before the return in PHYSFS_seek. This makes is work just fine. Although I'm new to PhysFS, this seems like a bug to me. I'm surprised no one else has picked this up before, so am just wondering if I'm wrong in assuming that PHYSFS_tell(PHYSFS_filelength(handle)) should always return PHYSFS_filelength(handle).

That's it really,

Tree


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20030128/f21b249d/attachment.htm>


More information about the physfs mailing list