[physfs] Wishlist

Christoph Nelles evilazrael at evilazrael.de
Wed Jan 27 09:54:26 EST 2010


On Wed, 27 Jan 2010 15:34:09 +0100, Tim Čas <darkuranium at gmail.com> wrote:
> Excellent ideas by Christoph Nelles, I would like to second all of
those.
> 
> However, I would like to add:
> 5) read/write access to files (there already is write access, why
couldn't
> same/similar method be used for R/W? What are the issues?)

Hm, i thought about this, which is another nice feature but after checking
with c++ i've abandoned this idea. In C++ a file opened for read/write
(fstream) is just a file opened twice, once for read and once for write,
you will get to separate current pointers, too with functions seekg (for
setting the read pointer) and seekp (for setting the write pointer). If i
make my own iostream implementation, i will propably need 2 file opens
nethertheless. 
Standard C's fopen & open can open files for RW operations, too. The only
problem i see at the moment is that you may get different files in the
search path and write dir. 
Write dir: 
c:/writedir/dummy.txt

dummy.txt in the search path: 
c:/game/datafiles1/dummy.txt
c:/writedir/dummy.txt

PHYSFS_openRead will open c:/game/datafiles1/dummy.txt and
PHYSFS_openWrite will open c:/game/datafiles1/dummy.txt -----> BANG! so you
would need 2 different behaviours. 

-- 
Christoph Nelles

E-Mail    : evilazrael at evilazrael.de
Jabber    : eazrael at evilazrael.net      ICQ       : 78819723

PGP-Key   : ID 0x424FB55B on subkeys.pgp.net
            or http://evilazrael.net/pgp.txt


More information about the physfs mailing list