delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/03/13:10:27

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20030603170911.54952.qmail@web40611.mail.yahoo.com>
Date: Tue, 3 Jun 2003 10:09:11 -0700 (PDT)
From: Greg Fenton <greg_fenton AT yahoo DOT com>
Subject: Path separator
To: cygwin AT cygwin DOT com
MIME-Version: 1.0

I am looking to enhance SWISH-E ( http://www.swish-e.org )to support
Cygwin.  It builds and runs just fine, but internally the code takes a
configuration parameter and if it is a shell-command, converts all of
the "/" characters to "\".

For example, if IndexDir is set to "c:/swish-e/bin/spider.pl", then
this gets converted to "c:\swish-e\bin\spider.pl" and gets passed to
popen().

This works well for running within the Win32 environment, but causes
problems within Cygwin (Cannot execute "c:swish-ebinspider.pl").

Currently the code simply has:

#ifdef _WIN32
    make_windows_path( cmd );
#endif

and make_windows_path() blindly replaces '/' for '\'.

I'd like to have one binary support both Cygwin and native Win32
environments.  Suggestions on the "cleanest" way?

I figure that I can either:
 - detect at runtime whether we're in Cygwin (how?)
 - use an environment variable to determine the appropriate path
separator (is there one?)

Thanks in advance,
greg_fenton.


=====
Greg Fenton
greg_fenton AT yahoo DOT com

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019