current working directory

Miles Vignol mvignol at earthlink.net
Fri Apr 9 15:08:07 EDT 2004


hi.  i'm new to physFS and have a few questions.

is there a way to get the current working directory in platform-indipendent format?

also, i would suggest that a toggle feature be added for security features ("." and ".." being ignored).  perhaps two distinct security settings -- one for reading, one for writing.  "." in particular is useful for enumerating files in a search directory that doesn't have a subdirectory of interest.  for example, i'm defining a series of "font" directories and would like to get all the files in them.  so i need to use "." as the sub-dir in the enumeration.  i just commented out the security code in a static link version, so i feel a little dirty.

in my case, i don't need security at all, but then maybe i'm using physFS in a manner it wasn't necessarily designed for -- more as an abstraction layer between me and the file system, and less as an archival file system manager...thing... (tho i will certainly use this feature).  so it seems like a flag setting (a la the sym link following flag) would make sense to alter this behavior.

also, i'm exposing some of the internal stuff.  namely to get around the file search path.  i'm essentially piggybacking on the platform indipendent DIR functions (ennumerate and openDirectory specifically) to get at the file system directly for a file selector box.  is this particularly dangerous for some reason?   this usage is why i'm curious about the platform indipendent working directory spec.

also, i'm wondering if a more explicit mapping should exist between the various file system notations, and perhaps a couple helper functions to map between them.  for example, "/" on a windows machine doesn't make any sense without a drive letter.  perhaps enumerating "/" on a windows machine would yield all the drive letters that are attached, such that "/c/dir" would be translated to "c:\dir".  going from "/usr/tmp" would be difficult -- "/usr" doesn't map well to windows land, but maybe that's beyond the scope of the problem.  at least this would allow generic code to access the file system.

it would also be nice to have pushing and popping of the search directories.  since it's a global setup, if i have multiple search paths, i have to add and remove a lot.  it would be nice to just push, define a new path, do what i need, then pop.  also, a "clear search path" would be nice (instead of asking what it is, then removing everything individually).


anyway, like i said, i'm new to physFS so maybe some of these issues have been discussed or even addressed and i'm just missing it...


-miles vignol
fathom entertainment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20040409/bd457b31/attachment.htm>


More information about the physfs mailing list