Alexander Donev asked:
> I gather the scope of UNIT numbers is global per process, meaning once I
> OPEN unit #100 in a process, this unit is available globally (without
> regard to any scope like for variables) inside a program (a process
> under UNIX, even if multithreaded), so that one needs to be careful
> about finding available unit numbers. Is this correct? Can someone at
> least briefly explain to me why this system was made, instead of the
> OPEN or other statements explicitly returning a UNIT without the user
> having to enter one (like FILE pointers in C).
Fortran pre-standardization and Fortran 66 had units, but no OPEN
statements. OPEN statements (and asterisk units) arrived in 1977.
> Also, is there a way to write to something like /dev/null under
> UNIX (i.e. fake IO)? With scratch files the actual IO still happens--I
> want to ignore all WRITEs to a given UNIT.
Have you tried opening the unit with FILE="/dev/null"?
--
What fraction of Americans believe | Van Snyder
Wrestling is real and NASA is fake? | [log in to unmask]
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Dan Goldin, George Bush, the Pope, or anybody else.
|