[physfs] PHYSFS_seek is too simple

fy fy0748 at gmail.com
Mon Dec 3 21:43:33 EST 2012

在 Tue, 04 Dec 2012 02:44:21 +0800,Christoph Nelles  
<evilazrael at evilazrael.de> 写道:

> Hi,
> write your own small wrapper function with the third parameter which  
> translates relative positions to >absolute positions.   It is not so  
> difficult, just a little bit of math (and physfs_tell). The worst is  
> >probably SEEK_END. If Physfs_uint64 is a problem for you, try a weak &  
> dynamic typed language.

Well, I made a mistake...

2882 /**
2883 * \brief Move i/o position to a given byte offset from start.
2884 *
2885 * This method moves the i/o position, so the next read/write will
2886 * be of the byte at (offset) offset. Seeks past the end of file should
2887 * be treated as an error condition.
2888 *
2889 * \param io The i/o instance to seek.
2890 * \param offset The new byte offset for the i/o position.
2891 * \return non-zero on success, zero on error.
2892 */
2893 int (*seek)(struct PHYSFS_Io *io, PHYSFS_uint64 offset);

The PHYSFS_seek moves i/o position to a given byte offset from START,
not CURRENET position.

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

More information about the physfs mailing list