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: cygwin changes default directory of (fortran) code


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 process
to 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 prints
the 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@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		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/


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