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


On 1/25/2014 3:04 PM, Steven Bardwell wrote:
> 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.

-- 
Larry

Thanks so much -- these suggestions now have my 32-bit install working the
same
way as the 64-bit install. Both machines seem to be handling paths
identically, and
they can both find Cygwin paths when run from CMD.exe even when these paths
are 
referred to by APIs which I can't explicitly set (like /dev/null and
/dev/shm).

Steve



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