apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Split paths portability
Date Wed, 17 Apr 2002 19:22:27 GMT
At 02:16 PM 4/17/2002, William A. Rowe, Jr. wrote:
>While we consider Stas' ideas for a portable tmpdir, we should also consider
>breaking apart path strings (such as env('PATH'), or LIB or INCLUDE paths
>as well.)  These semantics change considerably from Win32 to unix and
>other platforms.  I dunno what NetWare does here, anymore.
>
>Two options; the one I like best (I think) is returning an 
>apr_array_header_t *
>allocated based on a pool arg.  Contrawise, we should also have a function
>that returns a char* from an apr_array_header_t.  Something like;
>
>   apr_array_header_t *apr_filepath_list_split(const char *pathlist, 
> apr_pool_t *pool);
>   char *apr_filepath_list_join(apr_array_header_t *paths, apr_pool_t *pool);

Hmmm.  While I think about this, I also suppose we aught to add the same flags
option we pass to apr_filepath_merge and family.

We should allow the user to retrieve a list of APR_FILEPATH_NATIVE strings, or
by default, turn them into APR-recognized format (e.g. forward slashes on 
Win32,
etc.)  And on apr_filepath_list_join, we should allow APR_FILEPATH_NATIVE to
create platform-recognized paths for substitution as the PATH variable, etc.

Other thoughts or observations?

Bill


Mime
View raw message