From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68347 invoked by alias); 8 Dec 2016 18:50:29 -0000 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 Received: (qmail 68338 invoked by uid 89); 8 Dec 2016 18:50:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=BAYES_50,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*F:D*yandex.ru, Andrey, andrey, Hx-languages-length:1143 X-HELO: forward5m.cmail.yandex.net Received: from forward5m.cmail.yandex.net (HELO forward5m.cmail.yandex.net) (5.255.216.23) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Dec 2016 18:50:19 +0000 Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::27]) by forward5m.cmail.yandex.net (Yandex) with ESMTP id AB57621429; Thu, 8 Dec 2016 21:50:15 +0300 (MSK) Received: from smtp3o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3o.mail.yandex.net (Yandex) with ESMTP id 227C62940DAB; Thu, 8 Dec 2016 21:50:14 +0300 (MSK) Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id QHbKeXucpk-oEPurh8o; Thu, 08 Dec 2016 21:50:14 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Thu, 08 Dec 2016 18:45:34 -0000 Date: Thu, 08 Dec 2016 18:50:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <887116862.20161208214534@yandex.ru> To: Dipak Gaigole , cygwin@cygwin.com Subject: Re: Problem with chdir and GetCurrentDirectory on Windows 2016 In-Reply-To: References: <6e5968a1-a667-f911-fbec-f83e4ef34608@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00089.txt.bz2 Greetings, Dipak Gaigole! >>>> >>>> So in this situation, is it possible to get the cwd value as >>>> "/cygdrive/c/temp/appdir/bin" using some cygwin API? >>> >>> No, it is generally not possible to get the POSIX path to anything in >>> the cygwin root (/) tree to be prefixed by the /cygdrive prefix. The >>> /cygdrive prefix exists solely to resolve paths that are outside of /, >>> so paths inside that tree don't need the /cygdrive prefix. >>> >> This path is also displayed to the enduser at different places. So our >> requirement is to always get a path in the /cygdrive/ prefix format >> irrespective of whether it is inside the cygwin root (/) or outside of >> /. > I think this can be achieved by getcwd () + > cygwin_conv_path(CCP_POSIX_TO_WIN_A,...) and converting the windows > style path to /cygdrive/ prefix format. No, this is wrong approach. Do not do manual path manipulation, it WILL fail. Always use corrsponding conversion tools provided by Cygwin. -- With best regards, Andrey Repin Thursday, December 8, 2016 21:44:42 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