Making Unix like paths work when using java program from Cygwin

Marilo narium85-mlscar@yahoo.co.uk
Fri May 18 15:50:00 GMT 2012



--- On Fri, 18/5/12, Earnie Boyd  wrote:

> From: Earnie Boyd 
> Subject: Re: Making Unix like paths work when using java program from Cygwin
> Date: Friday, 18 May, 2012, 16:15
> On Fri, May 18, 2012 at 11:11 AM,
> Marilo wrote:
> > The java aspect looks like a red herring as not
> relevant to the problem.
> >
> > You want to run a *nix shell script and presumably
> don't want to write your own bat file doing the same job.
> >
> > I'm probably missing something but given that there's
> cygwin, and it's a *nux script, what about just editing the
> script for your computer, amending the paths in the script,
> with  a find and replace, so /ABC/XYZ is replaced with
> /cygdrive/c/ABC/XYZ and running the script in cygwin.
> 
> http://cygwin.com/acronyms/#TOFU
> 
> Why invent that wheel when you have cygpath already to do
> the job?
> And java isn't going to understand /cygdrive/c either.
> 

Still use /cygdrive/c in the shell script.

I wasn't suggesting using /cygdrive/c in his java program.  His java program is not so much a cygwin issue, as his shell script is.  If his java program has file paths that need amending, then since you point out that a cygwin program could be used to help convert the paths in his java program, then, I see, the java program could be relevant to cygwin in that sense. Note java wouldn't understand "c:\blah\a.txt"   it could have "c:\\blah\a.txt" though.  A search and replace might be easier though, possibly using regex.

How do you get cygpath to do make /v into c:\v ?
$ cygpath -aw "/v"
C:\cygwin\v

and not that i'm suggesting it but out of curiousity, can cygpath take a file and convert any linux paths in it to windows paths? how?

and if it can't then i'm not sure its use for this.





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



More information about the Cygwin mailing list