On Wednesday, June 27, 2001, at 08:59 AM, [EMAIL PROTECTED] 
wrote:

Hi,
     I am writing a script to be used on Windows and many different 
flavors
of Unix.  I am looking for a good way to convert Unix paths to Windows.  
Any
Ideas?????

Not exactly an answer to your question, but perhaps something that may 
be of use to you...

The following cross platform snippet (found somewhere on the web, I 
believe) will return the path of where the script is running.

        if    ($0=~m#^(.*)\\#){ $cgidir = "$1"; }  # win/dos
        elsif ($0=~m#^(.*)/# ){ $cgidir = "$1"; }  # Unix
        else  {`pwd` =~ /(.*)/; $cgidir = "$1"; }  # Unix

I'm guessing you could use it to find a base directory, and then do 
relative stuff from there. You may also be able to use its test blocks 
to flag whether or not you're on a windows box and construct your 
relative paths accordingly. There are probably other ways that platform 
can be determined, but TMTOWTDI seems to be a credo around here.

Hope this helps.

Reply via email to