[physfs] PhysFS 1.1.1 causes corruption?

Ryan C. Gordon icculus at icculus.org
Mon Sep 15 06:23:13 EDT 2008


> Is this the correct behaviour of Physfs?

Yes, correct and documented behaviour.

    http://hg.icculus.org/icculus/physfs/file/release-1.0.0/physfs.h#l684


In regards to the comment on gna.org:

Removing an archive from the Search Path frees resources, closes 
physical files, etc. If we let you keep a handle to a file in a .zip, 
but close all our resources that reference that .zip, there would be 
problems. I don't think it's worth reference counting the archives, 
since this is just going to lead to memory leaks and poor design 
decisions at the application level.

For what it's worth, the proper Unix metaphor for 
PHYSFS_removeFromSearchPath() is not unlinking an inode, as the email 
you referenced suggests, but rather unmounting a filesystem. Indeed, in 
the development branch, PHYSFS_addToSearchPath(x,y) is shorthand for 
PHYSFS_mount(x, "/", y).

Naming the list of open archives the "search path" was probably the real 
design error here.

Feel free to forward this email, if you like.

--ryan.





More information about the physfs mailing list