Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-envelope-info: Message-Id: <5.2.1.1.2.20030604102619.02ed4598@pop.sonic.net> X-Sender: rschulz AT pop DOT sonic DOT net Date: Wed, 04 Jun 2003 10:33:34 -0700 To: cygwin AT cygwin DOT com From: Randall R Schulz Subject: Re: rsync and cygwin paths In-Reply-To: References: <3EDDF586 DOT 4040603 AT lapo DOT it> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed At 10:06 2003-06-04, Igor Pechtchanski wrote: >On Wed, 4 Jun 2003, Lapo Luchini wrote: > > > ... > > > > Please notice that there is a default prgoramm called "cygpath" that's > > really useful to convert path- and file-names between the two version, > > and it's not so hard to create "wrapper scripts" to convert them, e.g. > > (I copied this long ago from I-don't-remember-where): > > > > http://cygwin.com/cygwin-ug-net/using-utils.html#CYGPATH > > > > NEWARGS="" > > for arg in $@ ; > > do > > if [ -e "${arg}" ]; then > > NEWARGS="${NEWARGS} `cygpath -p -w "$arg"`" > > else > > NEWARGS="${NEWARGS} $arg" > > fi > > done > >Lapo, > >Note that the above won't work correctly if the program is expected to >create the file with a given name... IMO, there is no way of writing a >generic wrapper script without knowing anything about program parameters. > Igor Igor, Strictly speaking, that's true. Certainly Lapo's script fragment is too simple-minded to work in any kind of general setting. However for many purposes it's feasible to write some simple-minded heuristics that make the determination about when and how to apply "cygpath." I currently use a BASH script that uses a simple "case" statement to paper over the Cygwin / Windows interface for invoking the Java 2 SDK tools. The case statement's glob patterns detect whether any given argument is (probably) a file name or PATH-like entity and then applies cygpath as necessary. It can be fooled, of course, but in practice it works fine for me. Randall Schulz -- 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/