January 09, 2008 read binary file | ||||
---|---|---|---|---|
| ||||
Hi, I am passing of FORTRAN for D, but I have problem to read (access direct) binary file. In FORTRAN I make: real*4 x,wl,alfa //declaration real numbers OPEN(UNIT=10,FILE="file.ad",form='unformatted',access='direct',recl=len,STATUS='UNKNOWN') //open binary file read(10,*) x, wl, alfa //reading the numbers of file binary Or I can read everything that will be inside of file: do j=1,nt read(10,*) x(j) //vector enddo Can you help me please? Regards |
January 09, 2008 Re: read binary file | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jef Andrade | Reply to Jef, > Hi, > I am passing of FORTRAN for D, but I have problem to read (access > direct) > binary file. > In FORTRAN I make: > real*4 x,wl,alfa //declaration real numbers > OPEN(UNIT=10,FILE="file.ad",form='unformatted',access='direct',recl=le > n,STATUS='UNKNOWN') > //open binary file > read(10,*) x, wl, alfa //reading the numbers of file binary > Or I can read everything that will be inside of file: > > do j=1,nt > read(10,*) x(j) //vector > enddo > Can you help me please? > Regards If you just want to read in the whole file as an array take a look at the read function in: http://www.digitalmars.com/d/1.0/phobos/std_file.html |
Copyright © 1999-2021 by the D Language Foundation