win32 __PHYSFS_platformRealPath

Ryan C. Gordon icculus at
Thu Aug 30 11:57:43 EDT 2001

> Is _fullpath the same as GetFullPathName ?

I'm not exactly sure; my reading of the docs are that GetFullPathName()
won't work if you give it more than a filename (a relative or absolute

> Or could it be implemented using a FindFirstFile/FindNextFile?

What the function needs to do on win32, mostly, is something like this:

When __PHYSFS_platformRealPath() is called, the caller specifies a path.

1) Figure out if specified path has a drive letter at the front of it. If
not, append the current working drive to it.
2) Figure out if the rest of the path is relative or absolute (does it
start with a '\\' char?) If absolute, do nothing. If relative, append the
current working directory for the specified drive letter (see #1) after
the drive.
3) Go through the rest of the specified path, element by element. If an
element is ".", remove it. If an element is ".." remove it and the
previous element.
4) Return the newly-mangled string in a free()able block of memory.

That should probably cover it. To be honest, with the exception of the
calls to determine current working drive/directory, this can be done
without an API call on win32.


More information about the physfs mailing list