X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=qZojBG4QzuYPazZ7 v9+ZgzUeRvMUuxSDR8J1pFD5T28NkUXvFC4Wzm1rn23BghHsiuSwrWcnm6E07Mhy O/ONoooogKJrGEjM/hnWUV+6W1rlVyUv3jeckL9gVxLTKXMnHGvtKGss/RB+oYG2 1UKhisXpCGZ8uUfzHI9hevbF+uY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=default; bh=aRxewYIczXR1GDsw/XhYQi ywfAE=; b=fQG4ID8kB3GAAFILYYoS3U7orsUtXGQ+mAUJO0tNRIFIRfuV0YXR7O PwfPE3XkEBq0t9PTdk4PqMQNk5og28MEKj7IuzFXoV+APZF7i0iuBt3p3dk2KHEq eXnF1O6dVJYeNqB0xXZ7MKQX/t8w6CUEhSL0stSMawV1YZHogTvEY= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Date: Thu, 8 Dec 2016 21:45:34 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <887116862.20161208214534@yandex.ru> To: Dipak Gaigole , cygwin AT cygwin DOT com Subject: Re: Problem with chdir and GetCurrentDirectory on Windows 2016 In-Reply-To: References: <6e5968a1-a667-f911-fbec-f83e4ef34608 AT redhat DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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