any routines for manipulating file/path names?

"Seth Grover" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
Hi,

I've been using NSPR for just a few weeks after deciding to leave the
Apache Portable Runtime (because I disliked it's reliance on memory
pools). I'm trying to convert some of the code I'd written using the
APR and am realizing that some of the APR routines for dealing with
file/path names aren't covered by anything in the NSPR.

What I'm trying to do is write a portable "expand file name" routine.
In other words, if the program is running in /home/me/whatever and
there's a file called hello.txt, and I pass "./hello.txt" to this
function, it will resolve to /home/me/whatever/hello.txt.

I was accomplishing this in APR by calling apr_filepath_get to get the
current working directory, then apr_filepath_merge to merge the given
file name with this directory (which basically either navigate the
relative path if the filename given is a relative path or ignore the
current working directory if the filename given is an absolute path).

I've looked around the NSPR documentation and I'm not seeing anything
for dealing with path names at all. So my question(s):

- are there routines in the NSPR to do this and I'm just not seeing them?
- if not, is there a platform-portable way to get the "current directory"?

Any help would be appreciated. Thanks. NSPR is awesome, by the way,
I'm really liking it.

-Cheers,

Seth Grover

-- 
Seth Grover
sethdgrover[at]gmail[dot]com
http://grovers.us/seth

Who is John Galt?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.