This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

g77 : problem with unformatted file which come from HP-UX


Hello,
I've got a problem with unformatted files :
  I'd like to read unformatted files with g77(release 0.5.21) on linux redhat5.2)
  which are written with F77 on HP-UX(release 10.x).
On HP-UX :
       program examplewrite
         integer M,N
         parameter (M=10,N=10)
         real TAB1(M,N),TAB2(M,N)
         integer i,j
         do 1 j=1,N
         do 1 i=1,M
           TAB1(i,j)=1.0E0
           TAB2(i,j)=2.0E0
1       continue
         write(3) TAB1,TAB2
       end
I'd got a file ftn03 which I'd transfered with ftp and renamed fort.3 on linux
 
On linux :
       program exampleread
          integer M,N
         parameter (M=10,N=10)
         real TAB1(M,N),TAB2(M,N)
         read(3) TAB1,TAB2
       end 
      
I'd got the following message:
  do_us: off end of record
  apparent state : unit 3 named fort.3
  lately reading sequential unformatted external IO
  Aborted (core dumped)
 
It seems that the HP-station is a IEEE machine which means that :
  - numerical values are big endian;
  - unformatted files are sequential access by default.
Is PC-linux a IEEE machine ?
 
I've seen on the egcs web page that there is a new g77 release.
Can it avoid my problem?
 
Thanks for your answers
 
Jean-David Delemer
 
p.s. : I'm sorry to write such a bad english  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]