delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/06/16:34:16

X-Spam-Check-By: sourceware.org
Date: Fri, 06 Jul 2007 16:33:52 -0400
From: MVUKOVIC AT nycap DOT rr DOT com
Subject: Re: cygwin changes default directory of (fortran) code
In-reply-to: <Pine.GSO.4.63.0707061514290.7471@access1.cims.nyu.edu>
To: cygwin AT cygwin DOT com
Message-id: <c3d9fb22458f6.458f6c3d9fb22@nyroc.rr.com>
MIME-version: 1.0
X-Mailer: iPlanet Messenger Express 5.2 HotFix 2.10 (built Dec 26 2005)
References: <c429f9ef447d4 DOT 447d4c429f9ef AT nyroc DOT rr DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0707061514290 DOT 7471 AT access1 DOT cims DOT nyu DOT edu>
X-IsSubscribed: yes
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


----- Original Message -----
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Date: Friday, July 6, 2007 3:33 pm
Subject: Re: cygwin changes default directory of (fortran) code
To: MVUKOVIC AT nycap DOT rr DOT com
Cc: cygwin AT cygwin DOT com

> On Fri, 6 Jul 2007, MVUKOVIC wrote:
> 
> > Hello,
> >
> > I am compiling a fortran program using intel's compiler, and use 
> cygwin> for the command-line interface (I will be switching to a 
> linux machine
> > soon, so I am staying away from MS's visual studio).
> >
> > When I invoke the executable from cygwin, it tries to find the input
> > files in C:\windows\system32.  If I invoke it from the windows 
> command> prompt, it finds the files ok.  If I specify the full file 
> path, than I
> > don't have a problem in cygwin.
> >
> > I am a bit puzzled by this behavior because last time I did some 
> fortran> coding under the same environment (about a year ago), I do 
> not remember
> > having that issue.
> >
> > I could not find info on such behavior on the prior mailings.
> >
> > Any ideas/suggestions as to what may be going on?
> 
> To implement POSIX functionality like allowing to remove the current
> directory, Cygwin changes the Win32 current working directory of a 
> processto C:\WINDOWS\system32, while keeping its own notion of what 
> the CWD is.
> This is transparent to the Cygwin file IO calls, but will confuse the
> Win32 calls.
> 
> The CWD is inherited by child processes.  When invoking non-Cygwin
> programs, Cygwin's exec() should change the cwd back to its real 
> value.That doesn't seem to be happening in your case.
> 
> A simple testcase (e.g., a Win32 program that invokes getpwd() and 
> printsthe value) which ought to demonstrate the discrepancy should 
> be easy to
> produce.  If that works as expected, you'll need to check what else is
> happening in your FORTRAN executable.
> 	Igor
> -- 
>                        	http://cs.nyu.edu/~pechtcha/
>      |\      _,,,---,,_            pechtcha AT cs DOT nyu DOT edu | 
> igor AT watson DOT ibm DOT comZZZzz /,`.-'`'    -.  ;-;;,_        	Igor 
> Peshansky, Ph.D. (name changed!)
>     |,4-  ) )-,_. ,\ (  `'-'        	old name: Igor Pechtchanski
>    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
> 
> Belief can be manipulated.  Only knowledge is dangerous.  -- Frank 
> Herbert
> --
> 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/
> 
Igor,

Thank you for your explanation.

I think that there is some evidence of intermittent behavior that may
have been recently introduced into cygwin (The following is from memory
and should be taken as anecdotal evidence only):  

When I ran the code for the first time yesterday, it ran fine.  I then
downloaded gdb with the new setup.exe (I thought I could use it for
debugging the code), and after that I started having the aforementioned
problems.

So, I wonder if there was a recent change to the cygwin code that caused
this problem.

My knowledge of C is non-existant, so I'll go home for my Kernighan and
Ritchie book to check out your suggestion using getpwd().

Mirko

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