Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 28 Jan 2003 19:36:04 -0500 (EST)
From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
Reply-To: cygwin@cygwin.com
To: Soren A <soren_andersen@fastmail.fm>
cc: cygwin@cygwin.com
Subject: Re: cygwin path problems
In-Reply-To: <Xns9311AA1C68C0Fsoren1Gmane@80.91.224.249>
Message-ID: <Pine.GSO.4.44.0301281924390.26400-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Tue, 28 Jan 2003, Soren A wrote:

> Randall R Schulz <rrschulz@cris.com> wrote around 27 Jan 2003
> news:5.2.0.9.2.20030127110753.027a0b00@pop3.cris.com:
>
> > Note, too, that if you have a classpath variable in POSIX format
> > (colons and no drive letters), you'll need to use something like
> > "$(cygpath -pm "$POSIXCLASSPATH")" to convert it.
> >
> >
> > Only (_only_) Cygwin-linked code will understand the "/cygdrive/..."
> > file names.
>
> And also note that if you are trying to use (bash/posix-unixy) shell
> *wildcards* [ ;-) ] to pass filenames as _arguments_ to your Java class
> (program), you need to know that Java will receive them in Cygwin's
> posix format and won't grok them. The results of a shell expansion like
> this:
>
>    /cdv/D/goodies/babe*.jpg
>
> IOW, won't be formatted like
>
>   "/cdv/D/goodies/babe1.jpg:/cdv/D/goodies/babe2.jpg:[...]"
>
> but instead just as plain list of space-separated filespecs. AFAIK,
> `cygpath' cannot help you there (corrections will come as a surprise but
> are welcome, "cygpath" gurus). Of course a little more elaborate
> shell-wrapper magic might hack you a way out of that problem, robustness
> and speed-performance are likely to be lacking, tho.
>
> So if you run into this trouble you might want to go download my Java
> class "CygwinShellInterface", written to translate Cygwin's posix
> filenames into Win32 ones that Java understands:
>
>   http://home.att.net/~perlspinr/framesets/cygwininfo_frmset.html
>
> Or re-invent that wheel, your choice ;-)
>   Soren A

Why, one doesn't have to be a "cygpath" guru at all!  A little judicious
application of sed, and you can turn a space-separated path into a
colon-separated one.  Which reduces the problem to the one already
solved... ;-)

Seriously, though, you could use something like
	"`/bin/ls /cdv/D/goodies/babe*.jpg | cygpath -w -f -`"
as the argument.  This should expand all the files.

It would certainly be a good idea to add multiple filename capability to
cygpath.  If I have time over the next week, I'll submit a patch.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

