delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/01/26/06:08:58

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:reply-to:from:to:references:in-reply-to
:subject:date:message-id:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=nMm8SBkTa5Y/hjhu
ThonXasQlduaRMvTIGUkFaGcggLQmYuT+hd8CINbstxvSRIwAJZdl/wQlsWy0oRC
pJYnCmQfVbHkUda8IE6/1z/1UIRKnR5QX85iGxolxvqF0QzmYRnt6xd801XBrK4z
nFyEllY56cpF3/eBzswPHT/cAWA=
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:reply-to:from:to:references:in-reply-to
:subject:date:message-id:mime-version:content-type
:content-transfer-encoding; s=default; bh=VDzaebZDblJOXsYySHybHv
xvsQA=; b=nNiaVBzXJzHQx+RgXiP3a/cJn8pFzOS3gruLHhxExQsfxmL0b4GHlC
NcO1gf8qBqcRg5i6XMPykuKcu2v7mG02x70nEArlfgzu/qNfORA8y3WtVXHsF5Li
diX2goQ8ZnE9oLTFZjtMaHt1iw3wfhLSAw3rtlM0GgQQ0LUMXYV3Q=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2
X-HELO: p3plsmtpa08-08.prod.phx3.secureserver.net
Reply-To: <sbardwell AT lbmsys DOT com>
From: "Steven Bardwell" <SBardwell AT lbmsys DOT com>
To: <cygwin AT cygwin DOT com>
References: <089001cf1a08$af3154a0$0d93fde0$@lbmsys.com> <52E44031 DOT 6030800 AT cygwin DOT com>
In-Reply-To: <52E44031.6030800@cygwin.com>
Subject: RE: file path resolution in DOS window vs mintty window
Date: Sun, 26 Jan 2014 06:08:24 -0500
Message-ID: <000001cf1a86$f46a49e0$dd3edda0$@lbmsys.com>
MIME-Version: 1.0
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019