public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to pass parameters to a windows application
@ 2010-08-02  0:43 Jason Pyeron
  2010-08-02  6:49 ` Dave Hylands
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Jason Pyeron @ 2010-08-02  0:43 UTC (permalink / raw)
  To: cygwin

I am at my wits end trying to figure out how to execute this in bash

C:\WINDOWS>cmd /c "start "" "C:\Documents and Settings\All
Users\Desktop\projects\crisfield\trunk\etc""

jpyeron@phoenix /projects/crisfield
$ cmd /c "\"start \"\" \"C:\\Documents and Settings\\All
Users\\Desktop\\projects\\crisfield\\trunk\\etc\"\""
The filename, directory name, or volume label syntax is incorrect.

jpyeron@phoenix /projects/crisfield
$ cmd /c '\"start \"\" \"C:\\Documents and Settings\\All
Users\\Desktop\\projects\\crisfield\\trunk\\etc\"\"'
The filename, directory name, or volume label syntax is incorrect.

jpyeron@phoenix /projects/crisfield
$ cmd /c '\"start \"\" \"C:\\Documents and Settings\\All
Users\\Desktop\\projects\\crisfield\\trunk\\etc\"\"'
The network path was not found.

jpyeron@phoenix /projects/crisfield
$ cmd /c "start \"\" \"C:\\Documents and Settings\\All
Users\\Desktop\\projects\\crisfield\\trunk\\etc\""
# A windows alert box pops up saying \\ The network path was not found.

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.




--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02  0:43 How to pass parameters to a windows application Jason Pyeron
@ 2010-08-02  6:49 ` Dave Hylands
  2010-08-02  9:31   ` Andy Koppe
  2010-08-02 11:57   ` Jason Pyeron
  2010-08-02 15:55 ` Andrey Repin
  2010-08-03  7:27 ` Csaba Raduly
  2 siblings, 2 replies; 14+ messages in thread
From: Dave Hylands @ 2010-08-02  6:49 UTC (permalink / raw)
  To: cygwin

Hi Jason,

On Sun, Aug 1, 2010 at 5:43 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:
> I am at my wits end trying to figure out how to execute this in bash
>
> C:\WINDOWS>cmd /c "start "" "C:\Documents and Settings\All
> Users\Desktop\projects\crisfield\trunk\etc""

Based on your prompt, I'd say that you're not in bash.

cmd /c start "c:\Documents and Settings\"

works for me. From the cmd prompt,

cmd /c "start "c:\Documents and Settings""

works. I wrote a little program called open,
http://www.davehylands.com/Software/Open/

which opens files the same way as double clicking on them. It also
translates cygwin paths into Win32 paths if you build the cygwin
version.
If passed a directory name, it does the same as choosing "Explore".

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02  6:49 ` Dave Hylands
@ 2010-08-02  9:31   ` Andy Koppe
  2010-08-02 11:55     ` Harald Joerg
  2010-08-02 11:57     ` Jason Pyeron
  2010-08-02 11:57   ` Jason Pyeron
  1 sibling, 2 replies; 14+ messages in thread
From: Andy Koppe @ 2010-08-02  9:31 UTC (permalink / raw)
  To: cygwin

On 2 August 2010 07:49, Dave Hylands wrote:
>
> On Sun, Aug 1, 2010 at 5:43 PM, Jason Pyeron wrote:
>> I am at my wits end trying to figure out how to execute this in bash
>>
>> C:\WINDOWS>cmd /c "start "" "C:\Documents and Settings\All
>> Users\Desktop\projects\crisfield\trunk\etc""
>
> Based on your prompt, I'd say that you're not in bash.
>
> cmd /c start "c:\Documents and Settings\"
>
> works for me. From the cmd prompt,
>
> cmd /c "start "c:\Documents and Settings""
>
> works. I wrote a little program called open,
> http://www.davehylands.com/Software/Open/
>
> which opens files the same way as double clicking on them. It also
> translates cygwin paths into Win32 paths if you build the cygwin
> version.
> If passed a directory name, it does the same as choosing "Explore".

You should both have a look at 'cygstart'.

Andy

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02  9:31   ` Andy Koppe
@ 2010-08-02 11:55     ` Harald Joerg
  2010-08-02 11:57     ` Jason Pyeron
  1 sibling, 0 replies; 14+ messages in thread
From: Harald Joerg @ 2010-08-02 11:55 UTC (permalink / raw)
  To: cygwin

Andy Koppe <andy.koppe@gmail.com> writes:

> On 2 August 2010 07:49, Dave Hylands wrote:
>>
>> On Sun, Aug 1, 2010 at 5:43 PM, Jason Pyeron wrote:
>>> I am at my wits end trying to figure out how to execute this in bash
>>>
>>> C:\WINDOWS>cmd /c "start "" "C:\Documents and Settings\All
>>> Users\Desktop\projects\crisfield\trunk\etc""
>>
>> Based on your prompt, I'd say that you're not in bash.
>>
>> cmd /c start "c:\Documents and Settings\"
>>
>> works for me. From the cmd prompt,
>>
>> cmd /c "start "c:\Documents and Settings""
>>
>> works. I wrote a little program called open,
>> http://www.davehylands.com/Software/Open/
>>
>> which opens files the same way as double clicking on them. It also
>> translates cygwin paths into Win32 paths if you build the cygwin
>> version.
>> If passed a directory name, it does the same as choosing "Explore".
>
> You should both have a look at 'cygstart'.

Good that I'm typing so slow.

I was about to explain a procedure of mine which almost does what Jason
Pyeron wants, approximately working in almost every case, containing
lots of quote-escaping tricks (and starting with "`cygpath -u $COMSPEC`"
instead of the plain cmd, just in case)...  and making a total fool of
myself, given that cygstart does it all in one sweep.

Thanks for the nudge, Andy!
-- 
Cheers,
haj

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to pass parameters to a windows application
  2010-08-02  9:31   ` Andy Koppe
  2010-08-02 11:55     ` Harald Joerg
@ 2010-08-02 11:57     ` Jason Pyeron
  2010-08-02 23:17       ` Dave Hylands
  2010-08-03 11:26       ` Andy Koppe
  1 sibling, 2 replies; 14+ messages in thread
From: Jason Pyeron @ 2010-08-02 11:57 UTC (permalink / raw)
  To: cygwin



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 

> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com] On Behalf Of Andy Koppe
> Sent: Monday, August 02, 2010 5:31
> To: cygwin@cygwin.com
> Subject: Re: How to pass parameters to a windows application
> 
> On 2 August 2010 07:49, Dave Hylands wrote:
> >
> > On Sun, Aug 1, 2010 at 5:43 PM, Jason Pyeron wrote:
> >> I am at my wits end trying to figure out how to execute 
> this in bash
> >>
> >> C:\WINDOWS>cmd /c "start "" "C:\Documents and Settings\All 
> >> Users\Desktop\projects\crisfield\trunk\etc""
> >
> > Based on your prompt, I'd say that you're not in bash.
> >
> > cmd /c start "c:\Documents and Settings\"
> >
> > works for me. From the cmd prompt,
> >
> > cmd /c "start "c:\Documents and Settings""
> >
> > works. I wrote a little program called open, 
> > http://www.davehylands.com/Software/Open/
> >
> > which opens files the same way as double clicking on them. It also 
> > translates cygwin paths into Win32 paths if you build the cygwin 
> > version.
> > If passed a directory name, it does the same as choosing "Explore".
> 
> You should both have a look at 'cygstart'.

Hint taken, do not write what already exists. Thanks

It does not play nice with unc paths. Starting by cmd.exe /c start path does.
Suggestions?


jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
$ cygstart .

jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
$ cygstart //host67/inst
Unable to start '\\?\UNC\host67\inst': There is no application associated with
the given file name extension.

jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
$ start //host67/inst
++ cygpath -wa //host67/inst
+ dir='\\host67\inst'
+ cd 'C:\WINDOWS'
+ cmd /c 'start  \\host67\inst'

jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
$ cygstart doc/design/

jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
$ cygstart test\ dir/

jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
$ cygstart ..

jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
$ pushd //host67/documents/
//host67/documents /projects/cdnetdb/private/fxiao/cdnet

jpyeron@phoenix //host67/documents
$ cygstart .
Unable to start '\\?\UNC\host67\documents': There is no application associated
with the given file name extension.

jpyeron@phoenix //host67/documents
$ start .
++ cygpath -wa .
+ dir='\\host67\documents'
+ cd 'C:\WINDOWS'
+ cmd /c 'start  \\host67\documents'

jpyeron@phoenix //host67/documents
$



--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to pass parameters to a windows application
  2010-08-02  6:49 ` Dave Hylands
  2010-08-02  9:31   ` Andy Koppe
@ 2010-08-02 11:57   ` Jason Pyeron
  1 sibling, 0 replies; 14+ messages in thread
From: Jason Pyeron @ 2010-08-02 11:57 UTC (permalink / raw)
  To: cygwin

 

> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com] On Behalf Of Dave Hylands
> Sent: Monday, August 02, 2010 2:50
> To: cygwin@cygwin.com
> Subject: Re: How to pass parameters to a windows application
> 
> Hi Jason,
> 
> On Sun, Aug 1, 2010 at 5:43 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:
> > I am at my wits end trying to figure out how to execute this in bash
> >
> > C:\WINDOWS>cmd /c "start "" "C:\Documents and Settings\All 
> > Users\Desktop\projects\crisfield\trunk\etc""
> 
> Based on your prompt, I'd say that you're not in bash.

Yes the first example was not bash, that was my reference for what I am trying
in bash.

> 
> cmd /c start "c:\Documents and Settings\"
> 
> works for me. From the cmd prompt,
> 
> cmd /c "start "c:\Documents and Settings""
> 
> works. I wrote a little program called open, 
> http://www.davehylands.com/Software/Open/
> 
> which opens files the same way as double clicking on them. It 
> also translates cygwin paths into Win32 paths if you build 
> the cygwin version.
> If passed a directory name, it does the same as choosing "Explore".
> 
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.DaveHylands.com/
> 
> --
> 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
> 


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.



--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02  0:43 How to pass parameters to a windows application Jason Pyeron
  2010-08-02  6:49 ` Dave Hylands
@ 2010-08-02 15:55 ` Andrey Repin
  2010-08-03  7:27 ` Csaba Raduly
  2 siblings, 0 replies; 14+ messages in thread
From: Andrey Repin @ 2010-08-02 15:55 UTC (permalink / raw)
  To: Jason Pyeron, cygwin

Greetings, Jason Pyeron!

> I am at my wits end trying to figure out how to execute this in bash

C:\WINDOWS>>cmd /c "start "" "C:\Documents and Settings\All
> Users\Desktop\projects\crisfield\trunk\etc""

> jpyeron@phoenix /projects/crisfield
> $ cmd /c "\"start \"\" \"C:\\Documents and Settings\\All
> Users\\Desktop\\projects\\crisfield\\trunk\\etc\"\""
> The filename, directory name, or volume label syntax is incorrect.

$ cmd /c start "" "C:/Documents and Settings/All Users/Desktop/projects/crisfield/trunk/etc"

Windows support both (more precise would be "see no difference between) "/"
and "\" as directory separators. Since DOS 3.3 at least.


--
WBR,
 Andrey Repin (anrdaemon@freemail.ru) 02.08.2010, <19:51>

Sorry for my terrible english...


--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02 11:57     ` Jason Pyeron
@ 2010-08-02 23:17       ` Dave Hylands
  2010-08-03 11:43         ` Andy Koppe
  2010-08-03 11:26       ` Andy Koppe
  1 sibling, 1 reply; 14+ messages in thread
From: Dave Hylands @ 2010-08-02 23:17 UTC (permalink / raw)
  To: cygwin

Hi Jason,

>> You should both have a look at 'cygstart'.
>
> Hint taken, do not write what already exists. Thanks
>
> It does not play nice with unc paths. Starting by cmd.exe /c start path does.
> Suggestions?

My open utility plays nice with UNC paths...

I think I wrote open many many years ago (before I even started using
cygwin) and I've just been carrying it around with me. I added cygwin
path support when I started using cygwin.

I've added an alias to alias open to cygstart (I use gnome-open under Ubuntu).

Thanks for the tip.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02  0:43 How to pass parameters to a windows application Jason Pyeron
  2010-08-02  6:49 ` Dave Hylands
  2010-08-02 15:55 ` Andrey Repin
@ 2010-08-03  7:27 ` Csaba Raduly
  2 siblings, 0 replies; 14+ messages in thread
From: Csaba Raduly @ 2010-08-03  7:27 UTC (permalink / raw)
  To: cygwin

On Mon, Aug 2, 2010 at 2:43 AM, Jason Pyeron  wrote:
> I am at my wits end trying to figure out how to execute this in bash
>
> C:\WINDOWS>cmd /c "start "" "C:\Documents and Settings\All
> Users\Desktop\projects\crisfield\trunk\etc""
>
> jpyeron@phoenix /projects/crisfield
> $ cmd /c "\"start \"\" \"C:\\Documents and Settings\\All
> Users\\Desktop\\projects\\crisfield\\trunk\\etc\"\""
> The filename, directory name, or volume label syntax is incorrect.
(snip)

cygstart was already suggested; if it doesn't help, try single quotes :
$ cmd /c start 'C:\Documents and Settings\All Users\...'

Bash uses backslashes as the escape character so \trunk ends up as <TAB>runk.
Single quotes prevent bash from interpreting backslashes and spaces.

-- 
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02 11:57     ` Jason Pyeron
  2010-08-02 23:17       ` Dave Hylands
@ 2010-08-03 11:26       ` Andy Koppe
  2010-08-04 11:26         ` Corinna Vinschen
  1 sibling, 1 reply; 14+ messages in thread
From: Andy Koppe @ 2010-08-03 11:26 UTC (permalink / raw)
  To: cygwin

On 2 August 2010 12:56, Jason Pyeron wrote:
>> 'cygstart'.
>
> It does not play nice with unc paths. Starting by cmd.exe /c start path does.
> Suggestions?
>
>
> jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
> $ cygstart .
>
> jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
> $ cygstart //host67/inst
> Unable to start '\\?\UNC\host67\inst': There is no application associated with
> the given file name extension.

It's a bug.

Cygstart uses cygwin_conv_path to convert to a Windows path, which
produces UNC paths for network paths. Trouble is, the ShellExecute
API, which is used to do the actual opening, doesn't appear to support
UNC paths.

Cygpath already turns '\\?\UNC\' at the start of a path into plain ol
'\\' (unless the resulting path would be longer than MAX_PATH, in
which case the UNC path is mandatory). Mintty does the same thing when
a file is opened with Ctrl+click.

So cygstart would need to do the same. And mkshortcut too (because the
APIs involved in creating shortcuts have trouble with long paths too).
Basically, any program that passes a path converted with
cygwin_conv_path to Windows APIs might have this issue.

Therefore I'm wondering whether it wouldn't be better to address this
once and for all in cygwin_conv_path itself by doing what cygpath
does: assuming the resulting path fits into MAX_PATH, drop "\\?\" from
all long paths and turn "UNC\" into "\\".

Andy

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-02 23:17       ` Dave Hylands
@ 2010-08-03 11:43         ` Andy Koppe
  0 siblings, 0 replies; 14+ messages in thread
From: Andy Koppe @ 2010-08-03 11:43 UTC (permalink / raw)
  To: cygwin

On 3 August 2010 00:17, Dave Hylands wrote:
>> [cygstart] does not play nice with unc paths.
>> Starting by cmd.exe /c start path does.
>> Suggestions?
>
> My open utility plays nice with UNC paths...

... because it uses cygwin_posix_to_win32_path_list(), which doesn't
produce paths starting with '\\?\UNC\' instead of '\\'. That function
is deprecated for Cygwin 1.7 though, because it doesn't support
Unicode or paths longer than MAX_PATH.

Andy

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-03 11:26       ` Andy Koppe
@ 2010-08-04 11:26         ` Corinna Vinschen
  2010-08-04 19:40           ` Andy Koppe
  0 siblings, 1 reply; 14+ messages in thread
From: Corinna Vinschen @ 2010-08-04 11:26 UTC (permalink / raw)
  To: cygwin

On Aug  3 12:26, Andy Koppe wrote:
> On 2 August 2010 12:56, Jason Pyeron wrote:
> >> 'cygstart'.
> >
> > It does not play nice with unc paths. Starting by cmd.exe /c start path does.
> > Suggestions?
> >
> >
> > jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
> > $ cygstart .
> >
> > jpyeron@phoenix /projects/cdnetdb/private/fxiao/cdnet
> > $ cygstart //host67/inst
> > Unable to start '\\?\UNC\host67\inst': There is no application associated with
> > the given file name extension.
> 
> It's a bug.
> 
> Cygstart uses cygwin_conv_path to convert to a Windows path, which
> produces UNC paths for network paths. Trouble is, the ShellExecute
> API, which is used to do the actual opening, doesn't appear to support
> UNC paths.
> 
> Cygpath already turns '\\?\UNC\' at the start of a path into plain ol
> '\\' (unless the resulting path would be longer than MAX_PATH, in
> which case the UNC path is mandatory). Mintty does the same thing when
> a file is opened with Ctrl+click.
> 
> So cygstart would need to do the same. And mkshortcut too (because the
> APIs involved in creating shortcuts have trouble with long paths too).
> Basically, any program that passes a path converted with
> cygwin_conv_path to Windows APIs might have this issue.

It's a shame that not even the official Win32 APIs are always clean
in terms of the long path name definition.

> Therefore I'm wondering whether it wouldn't be better to address this
> once and for all in cygwin_conv_path itself by doing what cygpath
> does: assuming the resulting path fits into MAX_PATH, drop "\\?\" from
> all long paths and turn "UNC\" into "\\".

This is already implemented in cygwin_conv_path for some time, but
only for the CCP_POSIX_TO_WIN_A case.  I never expected that this would
also be necessary for the wide char case.  Anyway, I applied a matching
patch.  As long as the resulting wide char path is not longer than
MAX_PATH, it will be stripped of the long path prefix.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-04 11:26         ` Corinna Vinschen
@ 2010-08-04 19:40           ` Andy Koppe
  2010-08-05  8:21             ` Corinna Vinschen
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Koppe @ 2010-08-04 19:40 UTC (permalink / raw)
  To: cygwin

On 4 August 2010 12:26, Corinna Vinschen wrote:
> It's a shame that not even the official Win32 APIs are always clean
> in terms of the long path name definition.

Yep, and MSDN doesn't even seem to mention it.

>> Therefore I'm wondering whether it wouldn't be better to address this
>> once and for all in cygwin_conv_path itself by doing what cygpath
>> does: assuming the resulting path fits into MAX_PATH, drop "\\?\" from
>> all long paths and turn "UNC\" into "\\".
>
> This is already implemented in cygwin_conv_path for some time, but
> only for the CCP_POSIX_TO_WIN_A case.  I never expected that this would
> also be necessary for the wide char case.  Anyway, I applied a matching
> patch.  As long as the resulting wide char path is not longer than
> MAX_PATH, it will be stripped of the long path prefix.

Great. Seems to be working fine for me.

This allows dropping the equivalent hack from cygpath, doesn't it?

Andy

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to pass parameters to a windows application
  2010-08-04 19:40           ` Andy Koppe
@ 2010-08-05  8:21             ` Corinna Vinschen
  0 siblings, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2010-08-05  8:21 UTC (permalink / raw)
  To: cygwin

On Aug  4 20:40, Andy Koppe wrote:
> On 4 August 2010 12:26, Corinna Vinschen wrote:
> > It's a shame that not even the official Win32 APIs are always clean
> > in terms of the long path name definition.
> 
> Yep, and MSDN doesn't even seem to mention it.
> 
> >> Therefore I'm wondering whether it wouldn't be better to address this
> >> once and for all in cygwin_conv_path itself by doing what cygpath
> >> does: assuming the resulting path fits into MAX_PATH, drop "\\?\" from
> >> all long paths and turn "UNC\" into "\\".
> >
> > This is already implemented in cygwin_conv_path for some time, but
> > only for the CCP_POSIX_TO_WIN_A case.  I never expected that this would
> > also be necessary for the wide char case.  Anyway, I applied a matching
> > patch.  As long as the resulting wide char path is not longer than
> > MAX_PATH, it will be stripped of the long path prefix.
> 
> Great. Seems to be working fine for me.
> 
> This allows dropping the equivalent hack from cygpath, doesn't it?

Right, but it doesn't hurt either.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-08-05  8:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-02  0:43 How to pass parameters to a windows application Jason Pyeron
2010-08-02  6:49 ` Dave Hylands
2010-08-02  9:31   ` Andy Koppe
2010-08-02 11:55     ` Harald Joerg
2010-08-02 11:57     ` Jason Pyeron
2010-08-02 23:17       ` Dave Hylands
2010-08-03 11:43         ` Andy Koppe
2010-08-03 11:26       ` Andy Koppe
2010-08-04 11:26         ` Corinna Vinschen
2010-08-04 19:40           ` Andy Koppe
2010-08-05  8:21             ` Corinna Vinschen
2010-08-02 11:57   ` Jason Pyeron
2010-08-02 15:55 ` Andrey Repin
2010-08-03  7:27 ` Csaba Raduly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).