This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: file path resolution in DOS window vs mintty window


Greetings, Larry Hall (Cygwin)!

>> I would like to understand why Cygwin style paths do not work in a CMD (DOS)
>> window on my 32-bit Cygwin system, but work fine on my 64-bit Cygwin
>> install.
>>
>> Here is a simple example of the issue:
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>>
>> void main()
>> {
>>          char path_test_file[]={"/tmp"};
>>
>>          /* look for file */
>>          if (access(path_test_file,F_OK)!=0) {
>>                  fprintf(stderr, "%s does not exist\n", path_test_file);
>>                  exit(16);
>>          }
>>          fprintf(stderr, "%s exists\n", path_test_file);
>>          exit(0);
>> }
>>
>> Here is what I am seeing:
>>
>> 32-bit install       DOS -- can't find /tmp    SH.EXE  -- finds /tmp
>> 64-bit install       DOS--finds /tmp           SH.EXE -- finds /tmp

> It's hard to tell what you're asking here.  DOS won't understand Cygwin's
> POSIX paths.  It's possible to set things up so that the paths in both
> worlds are close enough that in many cases they are synonymous but that
> requires effort and isn't fool-proof.  From the information you've given,
> you haven't attempted this.  But if you're expecting Cygwin's POSIX paths
> to always "just work" in a DOS world (using cmd.exe), then you've
> misunderstood what Cygwin does for you.  You won't be able to achieve
> this just by having Cygwin.

> On the other hand, if you're claiming that running Cygwin's bash in cmd.exe
> doesn't match the behavior you get running Cygwin's bash in mintty.exe on
> your 32-bit install, it may very well be because of the orphan installs
> you have in C:\Cygwin and C:\Windows as well as the duplicated cygwin1.dll
> you have in your c:\Windows\system32 directory.  Clean all that up, reboot,
> and try again.  Actually, do this no matter whether it helps or not.  You'll
> only have trouble later if you keep this stuff around.

If I understand the test case provided, the OP compiling and running it's own
Cygwin-based application.
Incidentally, he expects it to work quite transparently across the broad of
different Cygwin installs. Which seems to not be the case.


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 26.01.2014, <10:33>

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]