Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conversion from FORTRAN to C#

Status
Not open for further replies.

akstaj

Programmer
Nov 25, 2013
2
IN
Hi Tek-Tip members,

Can anyone help me in finding an C# version of Reading a Binary File sequentially.

In Fortran I am writing the file with foll parameters
ACCESS = 'SEQUENTIAL'
FORM = 'UNFORMATTED'

With BinaryReader in C# I am able to read the contents as Stream but not Sequentially.

I have also attached a binary file which has content of 3 different datatypes and the sequence of writing is: CHARACTER(30), INTEGER, REAL
The resulting output is:
"Mike Tyson"
1234567890
1000.50
 
Regardless of how the binary file was written or which language was used to write it, shouldn't you be asking this question in the C# forum? ;-)
 
Hi salgerman,
I would have asked to the c# community, but they don't know anything about fortran. They are like What is SEQUENTIAL File access and stuff..
 
Allow me to be Devil's Advocate to your reasoning: What's C# ?

So, like I said...why would you even mention Fortran? Just describe in a programming-language-agnostic, plain-english manner what you want to achieve, period.

 
Use ACCESS='STREAM' when creating the file in the Fortran program

François Jacq
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top