public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Subject: Re: How to pass parameters to a windows application
Date: Tue, 03 Aug 2010 11:26:00 -0000	[thread overview]
Message-ID: <AANLkTim1x04h2Rhk-rH8sg3Gc0CN=VASG6xVFwjb3Kyh@mail.gmail.com> (raw)
In-Reply-To: <7B35B979DF6941628DE9A6D131AA3909@phoenix>

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

  parent reply	other threads:[~2010-08-03 11:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02  0:43 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTim1x04h2Rhk-rH8sg3Gc0CN=VASG6xVFwjb3Kyh@mail.gmail.com' \
    --to=andy.koppe@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).