[physfs] PATH_MAX

Dennis Schridde devurandom at gmx.net
Tue May 15 19:28:19 EDT 2007


Am Dienstag, 15. Mai 2007 schrieb Ryan C. Gordon:
> > Does PhysFS provide something like POSIX' PATH_MAX or Windows' MAX_PATH?
> > I support a game which was originaly ported from Windows and stores
> > copies of directory names in several locations. Therefore it needs to
> > know the maximum length of paths that PhysFS accepts or returns.
> > Or would it be safe to use the systems definition of PATH_MAX/MAX_PATH or
> > an own value, for that matter?
>
> Hmm...Let me think about that. There isn't a formal way to get this from
> PhysicsFS at the moment, and a given system may have different limits
> for different things. For example, a DOS system may have strict filename
> limits, but the .zip archiver can still have long filenames. This is why
>   many PlayStation games have one big archive on their disc, for what
> it's worth. I'm not sure the best way to handle this yet.
Thought about it again. Probably was a stupid question.
Given that this is "my" game, I could say that this game supports filenames up 
to X characters and then use strncpy on the minimum of {real length, max 
length} everywhere.
I could adjust that maximum supported length to the needs of my current 
archives and would still have more room left than before when the game used 
Windows pathnames (because of the mounting).
Then only modders would have to be told to keep care on that length.

--Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://icculus.org/pipermail/physfs/attachments/20070516/0b843b6b/attachment.pgp>


More information about the physfs mailing list