What about the PHYSFS_fileLength function?<br><br><div class="gmail_quote">On 28 April 2010 18:33, Patrice Mandin <span dir="ltr">&lt;<a href="mailto:mandin.patrice@orange.fr">mandin.patrice@orange.fr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello,<br>
<br>
In my applications I use the following code to get the length of file<br>
(this is with using SDL_RWops, but the concept is the same for most<br>
similar API):<br>
<br>
SDL_RWseek(src, 0, RW_SEEK_END);<br>
length = SDL_RWtell(src);<br>
<br>
<br>
Unfortunately, with physfs, the RW_SEEK_END operation fails (but should<br>
succeed from my pov), depending on the underlying archiver backend:<br>
<br>
archiver_grp.c, archiver_hog.c, archiver_iso9660.c, archiver_mvl.c,<br>
archiver_qpak.c all fails because of:<br>
<br>
BAIL_IF_MACRO(offset &gt;= entry-&gt;size, ERR_PAST_EOF, 0);<br>
<br>
<br>
Only 2 backends may succeed:<br>
<br>
archiver_lzma.c:<br>
BAIL_IF_MACRO(offset &gt; file-&gt;item-&gt;Size, ERR_PAST_EOF, 0);<br>
<br>
archiver_zip.c:<br>
BAIL_IF_MACRO(offset &gt; entry-&gt;uncompressed_size, ERR_PAST_EOF, 0);<br>
<br>
--<br>
Patrice Mandin<br>
WWW: <a href="http://pmandin.atari.org/" target="_blank">http://pmandin.atari.org/</a><br>
Programmeur Linux, Atari<br>
Spécialité: Développement, jeux<br>
<br>
<br>
_______________________________________________<br>
physfs mailing list<br>
<a href="mailto:physfs@icculus.org">physfs@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/physfs" target="_blank">http://icculus.org/mailman/listinfo/physfs</a><br>
</blockquote></div><br>