- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Forum,
in the following short program, I open a scratch file, write into it, and close it. Contrary to what I found said in the manual, after the program has run, there is still a file "fort.20" in my folder.
program scratch
open (20,form='binary')
write (20) 'helloworld'
close (20)
end program scratch
Yours sincerely,
Niels H. Veldhuijzen
Cito, POK
Arnhem, The Netherlands
niels.veldhuijzen@citogroep.nl
in the following short program, I open a scratch file, write into it, and close it. Contrary to what I found said in the manual, after the program has run, there is still a file "fort.20" in my folder.
program scratch
open (20,form='binary')
write (20) 'helloworld'
close (20)
end program scratch
Yours sincerely,
Niels H. Veldhuijzen
Cito, POK
Arnhem, The Netherlands
niels.veldhuijzen@citogroep.nl
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You didn't say STATUS='SCRATCH' in the OPEN.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Steve,
yes, that's right. In the paragraph on the "close" statement in the manual, I read: "Files opened without a filename are called "scratch" files. Scratch files are temporary and are always deleted upon normal program termination; specifying STATUS='KEEP' for scratch files causes a run-time error. " I gathered from this that a scratch file is defined as soon as you open a file without giving it a name. Obviously, I'm wrong here. Indeed, when reading the manual about the "open" statement, and especially about the "file" specifier, I learned that the "scratch" status must be given. Thanks.
Yours sincerely,
Niels H. Veldhuijzen
Cito, Arnhem, The Netherlands
niels.veldhuijzen@citogroep.nl
yes, that's right. In the paragraph on the "close" statement in the manual, I read: "Files opened without a filename are called "scratch" files. Scratch files are temporary and are always deleted upon normal program termination; specifying STATUS='KEEP' for scratch files causes a run-time error. " I gathered from this that a scratch file is defined as soon as you open a file without giving it a name. Obviously, I'm wrong here. Indeed, when reading the manual about the "open" statement, and especially about the "file" specifier, I learned that the "scratch" status must be given. Thanks.
Yours sincerely,
Niels H. Veldhuijzen
Cito, Arnhem, The Netherlands
niels.veldhuijzen@citogroep.nl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah... The text you quote, from the on-disk Reference Manual, describes the behavior only if you select the PowerStation Compatibility: General option. The Compaq Fortran default is that files opened without an explicit name are assigned a name based on the unit number. I'll have the text corrected. Thanks for pointing it out.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page