Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!diemen!sol!quan From: quan@sol.surv.utas.edu.au (Stephen Quan) Newsgroups: comp.lang.fortran Subject: Bug with file I/O? Message-ID: Date: 24 Jan 91 05:46:35 GMT Sender: news@diemen.utas.edu.au Distribution: comp Lines: 28 I ran the following on our SunOS machine, and guess what the output is? ------>start of test.f<------ program test integer buff(1) character*4 tmp equivalence (tmp,buff) 1 format (a4) open (10,file='test.dat',access='direct',recl=8,form='formatted') buff(1) = 10 write (10,1,rec=1) tmp buff(1) = 0 read (10,1,rec=1) tmp write (*,*) buff(1) close (10) end ------>end of test.f<------ What is the last value of buff(1)? 10? 0? ... NO, 32!! I need the result to be 10, can anybody tell me what I am doing wrong? For those who followed the thread "Array Dilemma", this problem is related to implementing BIG. This time, I am working on some big integers. -- Stephen Quan, University of Tasmania.