From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4320 invoked by alias); 3 Aug 2010 11:26:44 -0000 Received: (qmail 4305 invoked by uid 22791); 3 Aug 2010 11:26:43 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_YG,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qy0-f178.google.com (HELO mail-qy0-f178.google.com) (209.85.216.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Aug 2010 11:26:38 +0000 Received: by qyk2 with SMTP id 2so623957qyk.2 for ; Tue, 03 Aug 2010 04:26:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.245.16 with SMTP id ls16mr1000918qcb.130.1280834796306; Tue, 03 Aug 2010 04:26:36 -0700 (PDT) Received: by 10.229.230.137 with HTTP; Tue, 3 Aug 2010 04:26:36 -0700 (PDT) In-Reply-To: <7B35B979DF6941628DE9A6D131AA3909@phoenix> References: <7B35B979DF6941628DE9A6D131AA3909@phoenix> Date: Tue, 03 Aug 2010 11:26:00 -0000 Message-ID: Subject: Re: How to pass parameters to a windows application From: Andy Koppe To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2010-08/txt/msg00054.txt.bz2 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