digitalmars.D.learn - read binary file
- Jef Andrade (14/14) Jan 08 2008 Hi,
- BCS (4/21) Jan 08 2008 If you just want to read in the whole file as an array take a look at th...
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
Jan 08 2008
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? RegardsIf 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
Jan 08 2008