public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problem with chdir and GetCurrentDirectory on Windows 2016
@ 2016-12-07 20:23 Dipak Gaigole
  2016-12-07 20:34 ` Jeffrey Altman
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Dipak Gaigole @ 2016-12-07 20:23 UTC (permalink / raw)
  To: cygwin

Hello,

I am facing a very strange problem with chdir and GetCurrentDirectory.
After calling chdir (), the call to GetCurrentDirectory () returns
wrong value. I tested this on Windows 7 and Windows 2016. It is
working fine on Windows 7 whereas wrong values are returned on Windows
2016. I guess we should see the same behavior on Windows 10 (client
version of Windows 2016) as well.

#########################################################################
Administrator@windows2k16vika /cygdrive/c/src
$ cygcheck.exe -c cygwin
Cygwin Package Information
Package              Version        Status
cygwin               1.7.33-1       OK

Administrator@windows2k16vika /cygdrive/c/src
$ uname -a
CYGWIN_NT-10.0-WOW6 windows2k16vika 1.7.33-2(0.280/5/3) 2014-11-13
15:45 i686 Cygwin

Administrator@windows2k16vika /cygdrive/c/src
$ cat test_cwd.c
#include <stdio.h>
#include <unistd.h>
#include <windows.h>

#define BUF_SIZE 512

int main()
{
    int ret;
    char *dir;
    char dirname [BUF_SIZE];

    dir = "/cygdrive/c/Program Files";
    ret = chdir (dir);
    fprintf (stderr, "chdir (%s) reuturned <%d>\n", dir, ret);

    ret = GetCurrentDirectory(BUF_SIZE, dirname);
    if (ret)
        fprintf (stderr, "GetCurrentDirectory returned <%s>, ret =
<%d>\n", dirname, ret);

    dir = getcwd (dirname, BUF_SIZE);
    fprintf (stderr, "getcwd returned <%s>, ret = <%s>\n", dirname, dir);

    return 0;
}

Administrator@windows2k16vika /cygdrive/c/src
$ gcc -g -Wall -lKernel32 test_cwd.c  -o test_cwd

Administrator@windows2k16vika /cygdrive/c/src
$ ./test_cwd.exe
chdir (/cygdrive/c/Program Files) reuturned <0>
GetCurrentDirectory returned <C:\Pro>, ret = <6>
getcwd returned </cygdrive/c/Program Files>, ret = </cygdrive/c/Program Files>

Administrator@windows2k16vika /cygdrive/c/src
$
#########################################################################

Has anyone noticed such behavior on Windows 10 or 2016? Any
suggestions, pointers?

Thanks,
Dipak

--
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] 12+ messages in thread

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-07 20:23 Problem with chdir and GetCurrentDirectory on Windows 2016 Dipak Gaigole
@ 2016-12-07 20:34 ` Jeffrey Altman
  2016-12-07 21:03 ` Dipak Gaigole
  2016-12-07 21:08 ` Eric Blake
  2 siblings, 0 replies; 12+ messages in thread
From: Jeffrey Altman @ 2016-12-07 20:34 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

On 12/7/2016 3:23 PM, Dipak Gaigole wrote:
> GetCurrentDirectory returned <C:\Pro>, ret = <6>

GetCurrentDirectory failed with ERROR_INVALID_HANDLE.  As a result the
buffer was not populated.  What is in dirname[] is stack garbage.

My guess is that /cygdrive/c/Program Files is not associated with a
device or if it associated with a NTFS device the driver doesn't know
how to match /cygdrive with a valid path.

Jeffrey Altman



[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4081 bytes --]

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

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-07 20:23 Problem with chdir and GetCurrentDirectory on Windows 2016 Dipak Gaigole
  2016-12-07 20:34 ` Jeffrey Altman
@ 2016-12-07 21:03 ` Dipak Gaigole
  2016-12-07 21:08 ` Eric Blake
  2 siblings, 0 replies; 12+ messages in thread
From: Dipak Gaigole @ 2016-12-07 21:03 UTC (permalink / raw)
  To: cygwin

> GetCurrentDirectory failed with ERROR_INVALID_HANDLE.  As a result the
> buffer was not populated.  What is in dirname[] is stack garbage.

As per the documentation of GetCurrentDirectory(), "If the function
succeeds, the return value specifies the number of characters that are
written to the buffer, not including the terminating null character."
So if I am not wrong, the return value 6 indicates the number of
characters written to the buffer.

Here is the output of the same program on my windows 7 system:
Administrator@W-WIN7-56 /cygdrive/c/temp
$ ./test_cwd.exe
chdir (/cygdrive/c/Program Files) reuturned <0>
GetCurrentDirectory returned <C:\Program Files>, ret = <16>
getcwd returned </cygdrive/c/Program Files>, ret = </cygdrive/c/Program Files>

Administrator@W-WIN7-56 /cygdrive/c/temp
$



On Thu, Dec 8, 2016 at 1:53 AM, Dipak Gaigole <dipakgaigole@gmail.com> wrote:
> Hello,
>
> I am facing a very strange problem with chdir and GetCurrentDirectory.
> After calling chdir (), the call to GetCurrentDirectory () returns
> wrong value. I tested this on Windows 7 and Windows 2016. It is
> working fine on Windows 7 whereas wrong values are returned on Windows
> 2016. I guess we should see the same behavior on Windows 10 (client
> version of Windows 2016) as well.
>
> #########################################################################
> Administrator@windows2k16vika /cygdrive/c/src
> $ cygcheck.exe -c cygwin
> Cygwin Package Information
> Package              Version        Status
> cygwin               1.7.33-1       OK
>
> Administrator@windows2k16vika /cygdrive/c/src
> $ uname -a
> CYGWIN_NT-10.0-WOW6 windows2k16vika 1.7.33-2(0.280/5/3) 2014-11-13
> 15:45 i686 Cygwin
>
> Administrator@windows2k16vika /cygdrive/c/src
> $ cat test_cwd.c
> #include <stdio.h>
> #include <unistd.h>
> #include <windows.h>
>
> #define BUF_SIZE 512
>
> int main()
> {
>     int ret;
>     char *dir;
>     char dirname [BUF_SIZE];
>
>     dir = "/cygdrive/c/Program Files";
>     ret = chdir (dir);
>     fprintf (stderr, "chdir (%s) reuturned <%d>\n", dir, ret);
>
>     ret = GetCurrentDirectory(BUF_SIZE, dirname);
>     if (ret)
>         fprintf (stderr, "GetCurrentDirectory returned <%s>, ret =
> <%d>\n", dirname, ret);
>
>     dir = getcwd (dirname, BUF_SIZE);
>     fprintf (stderr, "getcwd returned <%s>, ret = <%s>\n", dirname, dir);
>
>     return 0;
> }
>
> Administrator@windows2k16vika /cygdrive/c/src
> $ gcc -g -Wall -lKernel32 test_cwd.c  -o test_cwd
>
> Administrator@windows2k16vika /cygdrive/c/src
> $ ./test_cwd.exe
> chdir (/cygdrive/c/Program Files) reuturned <0>
> GetCurrentDirectory returned <C:\Pro>, ret = <6>
> getcwd returned </cygdrive/c/Program Files>, ret = </cygdrive/c/Program Files>
>
> Administrator@windows2k16vika /cygdrive/c/src
> $
> #########################################################################
>
> Has anyone noticed such behavior on Windows 10 or 2016? Any
> suggestions, pointers?
>
> Thanks,
> Dipak

--
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] 12+ messages in thread

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-07 20:23 Problem with chdir and GetCurrentDirectory on Windows 2016 Dipak Gaigole
  2016-12-07 20:34 ` Jeffrey Altman
  2016-12-07 21:03 ` Dipak Gaigole
@ 2016-12-07 21:08 ` Eric Blake
  2016-12-07 22:22   ` Dipak Gaigole
  2 siblings, 1 reply; 12+ messages in thread
From: Eric Blake @ 2016-12-07 21:08 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1695 bytes --]

On 12/07/2016 02:23 PM, Dipak Gaigole wrote:
> Hello,
> 
> I am facing a very strange problem with chdir and GetCurrentDirectory.

Not strange at all.  The two are incompatible.  When writing Cygwin
programs, stick to the POSIX-y interface, NOT the windows interface.

> After calling chdir (), the call to GetCurrentDirectory () returns

chdir() is POSIX, and the POSIX counterpart is getcwd(), which will
return the right value always.  GetCurrentDirectory() is the windows
API, which may or may not have a sane value at any given time, but more
often than not does NOT match the value in getcwd(), and that is by
design - because the Cygwin notion of the working directory is more
powerful than the windows notion of the working directory, and it is
just too expensive for cygwin to try and always keep windows up-to-date
with the current directory when there are times that you can be in a
cygwin directory that has no windows counterpart.


> Administrator@windows2k16vika /cygdrive/c/src
> $ cat test_cwd.c
> #include <stdio.h>
> #include <unistd.h>
> #include <windows.h>

Any code that does this is already suspect.

> 
> #define BUF_SIZE 512
> 
> int main()
> {
>     int ret;
>     char *dir;
>     char dirname [BUF_SIZE];
> 
>     dir = "/cygdrive/c/Program Files";
>     ret = chdir (dir);
>     fprintf (stderr, "chdir (%s) reuturned <%d>\n", dir, ret);
> 
>     ret = GetCurrentDirectory(BUF_SIZE, dirname);

Again, DON'T use windows API calls from a cygwin program, use POSIX
calls instead. You WANT to use getcwd() here.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-07 21:08 ` Eric Blake
@ 2016-12-07 22:22   ` Dipak Gaigole
  2016-12-07 23:06     ` Eric Blake
  0 siblings, 1 reply; 12+ messages in thread
From: Dipak Gaigole @ 2016-12-07 22:22 UTC (permalink / raw)
  To: cygwin

>> I am facing a very strange problem with chdir and GetCurrentDirectory.
>
> Not strange at all.  The two are incompatible.  When writing Cygwin
> programs, stick to the POSIX-y interface, NOT the windows interface.
>
>> After calling chdir (), the call to GetCurrentDirectory () returns
>
> chdir() is POSIX, and the POSIX counterpart is getcwd(), which will
> return the right value always.  GetCurrentDirectory() is the windows
> API, which may or may not have a sane value at any given time, but more
> often than not does NOT match the value in getcwd(), and that is by
> design - because the Cygwin notion of the working directory is more
> powerful than the windows notion of the working directory, and it is
> just too expensive for cygwin to try and always keep windows up-to-date
> with the current directory when there are times that you can be in a
> cygwin directory that has no windows counterpart.
>

That perfectly explains the reason behind the behavior I am facing.

> Again, DON'T use windows API calls from a cygwin program, use POSIX
> calls instead. You WANT to use getcwd() here.
>

I dig into the source code history and found that windows APIs are
used to make some use case work. Here is the simple usecase:
##############################################
C:\Temp\appdir>dir
 Volume in drive C is C_Drive
 Volume Serial Number is DE87-B7F1

 Directory of C:\Temp\appdir

12/08/2016  03:24 AM    <DIR>          .
12/08/2016  03:24 AM    <DIR>          ..
12/08/2016  03:18 AM    <DIR>          bin
11/13/2014  08:15 PM         3,247,117 cygwin1.dll
12/08/2016  03:06 AM               567 test_cwd.c
12/08/2016  03:12 AM           387,593 test_cwd.exe
               3 File(s)      3,635,277 bytes
               3 Dir(s)  27,981,082,624 bytes free

C:\Temp\appdir>.\test_cwd.exe "bin"
chdir (bin) reuturned <0>
GetCurrentDirectory returned <C:\Temp\appdir\bin>, ret = <18>
getcwd returned </appdir/bin>, ret = </appdir/bin>

C:\Temp\appdir>
##############################################
Please note that I have the cygwin1.dll in the "C:\Temp\appdir"
directory. So after changing the directory to "bin", the getcwd()
returned "/appdir/bin". And our requirement was to get
"/cygdrive/c/temp/appdir/bin", so the GetCurrentDirectory() approach
was used.

So in this situation, is it possible to get the cwd value as
"/cygdrive/c/temp/appdir/bin" using some cygwin API?

Thanks,
Dipak

--
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] 12+ messages in thread

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-07 22:22   ` Dipak Gaigole
@ 2016-12-07 23:06     ` Eric Blake
  2016-12-07 23:52       ` Dipak Gaigole
  0 siblings, 1 reply; 12+ messages in thread
From: Eric Blake @ 2016-12-07 23:06 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1981 bytes --]

On 12/07/2016 04:22 PM, Dipak Gaigole wrote:

> C:\Temp\appdir>.\test_cwd.exe "bin"
> chdir (bin) reuturned <0>
> GetCurrentDirectory returned <C:\Temp\appdir\bin>, ret = <18>
> getcwd returned </appdir/bin>, ret = </appdir/bin>
> 
> C:\Temp\appdir>
> ##############################################
> Please note that I have the cygwin1.dll in the "C:\Temp\appdir"
> directory. So after changing the directory to "bin", the getcwd()
> returned "/appdir/bin". And our requirement was to get
> "/cygdrive/c/temp/appdir/bin", so the GetCurrentDirectory() approach
> was used.

If you want to convert a POSIX name to the corresponding Windows name,
chdir() and getcwd() is not the best approach; and
chdir()/GetCurrentDirectory() is the wrong approach.  Instead, either
call out to the 'cygpath' utility, or use the cygwin_conv_path() API
(https://cygwin.com/cygwin-api/func-cygwin-conv-path.html) (which is
what 'cygpath' uses under the hood).

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

But you seem to be asking the wrong question.  If the only reason you
want a "/cygdrive/c" prefix is so that you can supply textual conversion
of "/cygdrive/c" to "c:\", then it seems like your question is really
"how do I convert the POSIX path name given by getcwd() into the
corresponding Windows directory, if one exists".  Then you don't need to
do ANY post-processing of the string, because cygwin will have already
handed you the fully-converted name, by using cygwin_conv_path() correctly.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-07 23:06     ` Eric Blake
@ 2016-12-07 23:52       ` Dipak Gaigole
  2016-12-08 12:35         ` Dipak Gaigole
  0 siblings, 1 reply; 12+ messages in thread
From: Dipak Gaigole @ 2016-12-07 23:52 UTC (permalink / raw)
  To: cygwin

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

--
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] 12+ messages in thread

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-07 23:52       ` Dipak Gaigole
@ 2016-12-08 12:35         ` Dipak Gaigole
  2016-12-08 18:50           ` Andrey Repin
  0 siblings, 1 reply; 12+ messages in thread
From: Dipak Gaigole @ 2016-12-08 12:35 UTC (permalink / raw)
  To: cygwin

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

Thanks Eric for the pointers :)

--
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] 12+ messages in thread

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-08 12:35         ` Dipak Gaigole
@ 2016-12-08 18:50           ` Andrey Repin
       [not found]             ` <CADs2-=R_NxbDNom1MDyyBYgtCfifQ3V-D4jy2wNkHb7fUv0Org@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Andrey Repin @ 2016-12-08 18:50 UTC (permalink / raw)
  To: Dipak Gaigole, cygwin

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

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

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
       [not found]             ` <CADs2-=R_NxbDNom1MDyyBYgtCfifQ3V-D4jy2wNkHb7fUv0Org@mail.gmail.com>
@ 2016-12-09  7:24               ` Dipak Gaigole
  2016-12-09  8:42                 ` Csaba Raduly
  0 siblings, 1 reply; 12+ messages in thread
From: Dipak Gaigole @ 2016-12-09  7:24 UTC (permalink / raw)
  To: cygwin

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

Agreed Andrey. But I couldn't find any API(s) which can serve my
requirements. And we can't afford to execute (fork+exec) tools like
cygpath for each getcwd call.
Any suggestions on improving this approach or any alternative approach
are always welcome.

Thanks,
Dipak

--
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] 12+ messages in thread

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-09  7:24               ` Dipak Gaigole
@ 2016-12-09  8:42                 ` Csaba Raduly
  2016-12-12  9:12                   ` Dipak Gaigole
  0 siblings, 1 reply; 12+ messages in thread
From: Csaba Raduly @ 2016-12-09  8:42 UTC (permalink / raw)
  To: cygwin list

On Fri, Dec 9, 2016 at 8:24 AM, Dipak Gaigole  wrote:

> Agreed Andrey. But I couldn't find any API(s) which can serve my
> requirements. And we can't afford to execute (fork+exec) tools like
> cygpath for each getcwd call.
> Any suggestions on improving this approach or any alternative approach
> are always welcome.

https://cygwin.com/cygwin-api/func-cygwin-conv-path.html

Note the CCP_PROC_CYGDRIVE option.

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
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] 12+ messages in thread

* Re: Problem with chdir and GetCurrentDirectory on Windows 2016
  2016-12-09  8:42                 ` Csaba Raduly
@ 2016-12-12  9:12                   ` Dipak Gaigole
  0 siblings, 0 replies; 12+ messages in thread
From: Dipak Gaigole @ 2016-12-12  9:12 UTC (permalink / raw)
  To: cygwin

>
>> Agreed Andrey. But I couldn't find any API(s) which can serve my
>> requirements. And we can't afford to execute (fork+exec) tools like
>> cygpath for each getcwd call.
>> Any suggestions on improving this approach or any alternative approach
>> are always welcome.
>
> https://cygwin.com/cygwin-api/func-cygwin-conv-path.html
>
> Note the CCP_PROC_CYGDRIVE option.
>
Yes Csaba, I had evaluated this option but we are using an older
version of cygwin (1.7.33) which doesn't have this option available :(

Thanks,
Dipak

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

end of thread, other threads:[~2016-12-12  9:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-07 20:23 Problem with chdir and GetCurrentDirectory on Windows 2016 Dipak Gaigole
2016-12-07 20:34 ` Jeffrey Altman
2016-12-07 21:03 ` Dipak Gaigole
2016-12-07 21:08 ` Eric Blake
2016-12-07 22:22   ` Dipak Gaigole
2016-12-07 23:06     ` Eric Blake
2016-12-07 23:52       ` Dipak Gaigole
2016-12-08 12:35         ` Dipak Gaigole
2016-12-08 18:50           ` Andrey Repin
     [not found]             ` <CADs2-=R_NxbDNom1MDyyBYgtCfifQ3V-D4jy2wNkHb7fUv0Org@mail.gmail.com>
2016-12-09  7:24               ` Dipak Gaigole
2016-12-09  8:42                 ` Csaba Raduly
2016-12-12  9:12                   ` Dipak Gaigole

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