CALL SYSTEM from Fortran

Jun 28, 2008
29
0
#1
I found a problem with CALL SYSTEM from Fortran under Windows 7 64 bits.

The following small program:

call system('dir')
stop
end

shows the dir.

Under Windows XP 32 bits the directory shown is the current working directory (it is correct).

Under Windows 7 64 bits, the directory shown is the root directory n(it is a problem).

The same program shows the current working directory (the correct) when I run it from cmd.

Similar problems with other commands as delete, copy, etc.


Regards.
 
#2
From: oph
| I found a problem with CALL SYSTEM from Fortran under Windows 7 64
| bits.
|
| The following small program:
|
| call system('dir')
| stop
| end
|
| shows the dir.
|
| Under Windows XP 32 bits the directory shown is the current working
| directory (it is correct).
|
| Under Windows 7 64 bits, the directory shown is the root directory
| n(it is a problem).
|
| The same program shows the current working directory (the correct)
| when I run it from cmd.
|
| Similar problems with other commands as delete, copy, etc.

I suspect that your TCSTART.BTM on Win7 contains a command to change directory, while the one on your WinXP system does not.
--
HTH, Steve
 
#3
The last I knew (a long time ago) "system" (in "C") used CMD.EXE regardless of
%COMSPEC. Has that changed? Is it different with Fortran?

On Mon, 23 May 2011 09:19:19 -0400, Steve Fabian <> wrote:

|From: oph
|| I found a problem with CALL SYSTEM from Fortran under Windows 7 64
|| bits.
||
|| The following small program:
||
|| call system('dir')
|| stop
|| end
||
|| shows the dir.
||
|| Under Windows XP 32 bits the directory shown is the current working
|| directory (it is correct).
||
|| Under Windows 7 64 bits, the directory shown is the root directory
|| n(it is a problem).
||
|| The same program shows the current working directory (the correct)
|| when I run it from cmd.
||
|| Similar problems with other commands as delete, copy, etc.
|
|I suspect that your TCSTART.BTM on Win7 contains a command to change directory, while the one on your WinXP system does not.
 
#4
From: vefatica
| The last I knew (a long time ago) "system" (in "C") used CMD.EXE
| regardless of
| %COMSPEC. Has that changed? Is it different with Fortran?

That would depend on the RTL used when linking. With an MS-supplied RTL I'd not be surprised the above to be true.
--
Steve