[physfs] My shot at PHYSFS_stat

Indy Sams indy at driftsolutions.com
Mon Feb 15 15:41:20 EST 2010


Hello Ryan,

	Looks good, just one or 2 things to mention in the PHYSFS_stat function:

	At the top, I originally had it as "int retval = -1;" not "int retval = 0;" that way it defaults to failure in case any of the other parts fail or the file doesn't exist.

	On the note "/* !!! FIXME: what should this be set to if we fail completely? */": basically it wouldn't matter what is in the PHYSFS_Stat struct if the function fails, none of the values should be used unless PHYSFS_stat() returns 0.

	On this part:
	"if (exists)
		retval = 1; /* !!! FIXME: What's the right value? */"

	I don't remember exactly why I did that since I made it so long ago, but I assume I had a reason. I think it may have been for debugging purposes so it would return 1 if the mount point existed instead of -1 or something like that.

Monday, February 15, 2010, 2:12:14 PM, you wrote:


>> Both this work and Indy's have merit. I'm likely going to merge pieces 
>> of both and add you both to the credits.

RCG> Ok, this is in now, changeset 1054:57f4af811ffb.

RCG>     http://hg.icculus.org/icculus/physfs/rev/57f4af811ffb

RCG> I cleaned up some things, but the biggest change is that I got rid of 
RCG> getFileInfo()...I suppose this is meant to be an optimization for 
RCG> targets that could get, say, file timestamps easily but not file sizes
RCG> without uncompressing the whole file...but it doesn't apply to any 
RCG> current archivers, and I'd rather this use the simpler stat() interface.
RCG> It makes the code much cleaner.

RCG> Anyhow, you'll have to merge when you pull from my repo again, since 
RCG> even things that didn't get a specific change probably had tab 
RCG> characters removed, etc.

RCG> --ryan.

RCG> _______________________________________________
RCG> physfs mailing list
RCG> physfs at icculus.org
RCG> http://icculus.org/mailman/listinfo/physfs


Best regards,
 Indy Sams
 mailto:indy at driftsolutions.com

 P.S. This is what part of the alphabet would look like if Q & R were eliminated.



More information about the physfs mailing list