[comp.lang.fortran] BSD 4.3 F77 fortran query

mike@bucasb.bu.edu (Michael Cohen) (07/11/88)

Does anybody know an easy way to popen a stream which can be passed
to Fortran and associated with a fortran Unit,.  This is for a version
of BSD4.3 F77.  What was already tried was a fortran open followed
by a dup2 using the fortran unit as a file descriptor as passed to C.
This doesn't seem to work.  If anybody knows how to do this or
has the location of a routine which works this would be of interest.
                         

karish@denali.stanford.edu (Chuck Karish) (07/11/88)

In article <584632927.3487@bucasb.bu.edu> mike@bucasb.bu.edu (Michael Cohen) writes:
>Does anybody know an easy way to popen a stream which can be passed
>to Fortran and associated with a fortran Unit,.  This is for a version
>of BSD4.3 F77.  What was already tried was a fortran open followed
>by a dup2 using the fortran unit as a file descriptor as passed to C.

	There's no really portable way to do this, even among different
	ports of 4.x.  A colleague of mine wrote some code to do this
	under 4.2.  It uses low-level calls within the stdio library,
	and depends on knowledge of exactly how a file descriptor and a
	FORTRAN logical unit are implemented.  

	When I ported the code to Convex Unix (on a binary-only
	system), I had to guess about the changes in the internal
	interface.  I got lucky, and it worked for a while.  There's
	nothing to keep Convex from streamlining their stdio library
	and replacing or changing the name of one crucial interface, at
	which point my code dies.

Chuck Karish	ARPA:	karish@denali.stanford.edu
		BITNET:	karish%denali@forsythe.stanford.edu
		UUCP:	{decvax,hplabs!hpda}!mindcrf!karish
		USPS:	1825 California St. #5   Mountain View, CA 94041