delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/12/12/08:58:37

X-Spam-Check-By: sourceware.org
Date: Tue, 12 Dec 2006 08:58:10 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: cygstart getting The specified file was not found
In-Reply-To: <457EB1D6.7000908@mscha.nl>
Message-ID: <Pine.GSO.4.63.0612120853170.13093@access1.cims.nyu.edu>
References: <d064fc578e06c DOT 457da36f AT shaw DOT ca> <457E0CB8 DOT 5070002 AT mscha DOT nl> <20061212082036 DOT GY9829 AT calimero DOT vinschen DOT de> <457EAD4F DOT 1000605 AT mscha DOT nl> <457EB1D6 DOT 7000908 AT mscha DOT nl>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Tue, 12 Dec 2006, Michael Schaap wrote:

> Michael Schaap wrote:
> > Corinna Vinschen wrote:
> > >
> > > Does cygstart use CreateProcess and/or GetCurrentDirectory instead of
> > > fork/exec/getcwd?
> > >
> > > If so, cygstart will have to call cygwin_internal(CW_SYNC_WINENV)
> > > before using the native Windows functions.
> >
> > No, it uses ShellExecute (see "cygstart --reference").  It does indeed
> > need to sync the environment, but it does this using its own code.
> > (Predates cygwin_internal(CW_SYNC_WINENV); I still need to change
> > cygstart some day to use it.)
> >
> > However, this is unrelated to this problem, things go wrong long
> > before that.  It appears that cygwin_conv_to_win32_path incorrectly
> > determines the current working directory.
> >
> > It is called as follows:
> >
> >     cygwin_conv_to_win32_path(aPath, winPath);
> >
> > where aPath == "hello.txt".
> >
> > The current directory is "/cygdrive/c/user" =~ "c:\user", but
> > cygwin_conv_to_win32_path thinks that:
> >
> >     normalize_posix_path: /cygdrive/c/WINDOWS/system32/hello.txt =
> > normalize_posix_path (hello.txt)
> >
> > (See Eric's messages for more debugging info.)
>
> I just installed the 2006-12-11 snapshot, and I can reproduce this. Like
> Eric, I'm on XP SP2.
>
> I went down the list of snapshots, and it looks like this was introduced
> some time in between 2006-11-27 and 2006-11-30.

I just looked at the ChangeLog between those two snapshots.  The following
looks like the culprit change:

2006-11-29  Corinna Vinschen  <corinna AT vinschen DOT de>

        * path.cc [snip]
        (cwdstuff::init): Initialize cygheap->cwd with current working
        directory.  Change to windows_system_directory afterwards.

With that change, any use of non-Cygwin calls, e.g., GetCurrentDirectory,
or ShellExecute (which calls GetCurrentDirectory under the covers, it
seems) will produce the problem you're seeing (Windows system directory as
the current directory).

So it looks like you ought to call cygwin_internal(CW_SYNC_WINENV) after
all, as it syncs more than the environment variables...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Freedom is just another word for "nothing left to lose"...  -- Janis Joplin

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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