apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Split paths portability
Date Thu, 18 Apr 2002 03:29:41 GMT
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.

If you need the implementation details look at how Perl does it. it's in 
File::Spec which is a set of function working on Files/Dirs 
crossplatform. In this particular case these are the functions you want 
to look at:

              splitpath
              splitdir
              catdir
              catfile
              and a few other useful functions.

Currently Perl includes implementations for:

/home/stas/perl.org/perl-current/lib/File/Spec/Cygwin.pm
/home/stas/perl.org/perl-current/lib/File/Spec/Epoc.pm
/home/stas/perl.org/perl-current/lib/File/Spec/Mac.pm
/home/stas/perl.org/perl-current/lib/File/Spec/OS2.pm
/home/stas/perl.org/perl-current/lib/File/Spec/Unix.pm
/home/stas/perl.org/perl-current/lib/File/Spec/VMS.pm
/home/stas/perl.org/perl-current/lib/File/Spec/Win32.pm




-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message