A question about g77's OPEN & WRITE

Zhong Wang wangzhong_china@yahoo.com.cn
Sun Nov 3 05:41:00 GMT 2002


Hello, everybody

  I am using g77 for programing now. But I found that
g77 is somewhat 
different to Visual Fortran in I/O.

  In visual fortran, the following code is legal:
>>>>>
  REAL a(10)
  OPEN(10,file='aaa.dat',form='binary')
  WRITE(10)a
  CLOSE(10)
<<<<<
  You can see that in file aaa.dat there's not
anything between the integer 
and real numbers.
  But in g77, if I use:
>>>>>
  REAL a(10)
  OPEN(10,file='aaa.dat',form='unformatted')
  WRITE(10)a
  CLOSE(10)
<<<<<
  With "hexedit aaa.dat", you can find there's a
length value before and after 
each record. You know, sometimes we have to make more
efforts to deal with 
those length values when we use other softwares to
open these data files. For 
example, when I use matlab to open the file, I have to
read off those length 
values. It's very convinient.

  Can you recommend me a possible method with g77 to
generate data file which 
contains no extra bytes in it? Or can the developers
add some new features 
like form='direct' to g77?

  Thank you very much,
  Yours,
  mili


_________________________________________________________
Do You Yahoo!? 
"ÊÇIT¾«Ó¢Âð£¿Ð¡ÊÔÅ£µ¶»ñʱÉд󽱣¡"
http://cn.promo.yahoo.com/cgi-bin/udb/u



More information about the Gcc-help mailing list