View previous topic :: View next topic |
Author |
Message |
WDG
Joined: 13 May 2008 Posts: 14
|
Posted: Wed May 14, 2008 12:39 am Post subject: retired NEWBIE trying to use OPEN in FTN |
|
|
These 2 OPEN statements
OPEN(unit=9,FILE='dale.txt',STATUS='NEW')
OPEN(unit=8,FILE='mm.txt',STATUS='READONLY')
dale.txt gets created at C:\Plato
I get this error
Runtime error from program:c:\plato\checkmate\win32\test2.exe
Run-time Error
*** Error 128, File does not exist
READFILE - in file test2.for at line 14 [+00f2]
main - in file test2.for at line 4 [+0039]
file mm.txt does exist at c:\Plato
any ideas what I am doing wrong? |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Wed May 14, 2008 1:40 am Post subject: |
|
|
Two ideas,
1) compile with /debug to get the line number.
2) use iostat=iostat in open statements to control the error response.
OPEN(unit=9,FILE='dale.txt',STATUS='NEW',IOSTAT=iostat)
if (iostat /= 0) then
CALL FORTRAN_ERROR_MESSAGE@(iostat, MESSAGE)
write (*,*) iostat, message
end if
...
You may be having problems with STATUS=...
STATUS='UNKNOWN' is much more friendly. |
|
Back to top |
|
|
WDG
Joined: 13 May 2008 Posts: 14
|
Posted: Wed May 14, 2008 11:14 am Post subject: Thanks John |
|
|
|
|
Back to top |
|
|
|