<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Binary Files in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Binary-Files/m-p/797571#M36057</link>
    <description>Is it possible to rewind and over-write a record in sequential access binary file within the same program in which it is created?&lt;BR /&gt;&lt;BR /&gt;The program opens a file with:&lt;BR /&gt;&lt;BR /&gt;OPEN(UNIT=FID,&lt;BR /&gt;file = FileName, &lt;BR /&gt;Status='REPLACE', &lt;BR /&gt;Access='Sequential', &lt;BR /&gt;Form='binary',&lt;BR /&gt;IOSTAT=IERR)&lt;BR /&gt;&lt;BR /&gt;The first record written to the file is the number of additional records that the program intends to write.  It is possible that during the course of processing, the actual number of records written is less than the number intended. &lt;BR /&gt;&lt;BR /&gt;In this instance, I am trying to update the first record with the correct number.  The rewind statement doesn't return an error and neither does the write.  However, after closing and opening the file with another program, the original value in the first record persists, the update is not apparent.  &lt;BR /&gt;Any takers?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Thu, 17 Jul 2003 00:14:34 GMT</pubDate>
    <dc:creator>tlillys</dc:creator>
    <dc:date>2003-07-17T00:14:34Z</dc:date>
    <item>
      <title>Binary Files</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Binary-Files/m-p/797571#M36057</link>
      <description>Is it possible to rewind and over-write a record in sequential access binary file within the same program in which it is created?&lt;BR /&gt;&lt;BR /&gt;The program opens a file with:&lt;BR /&gt;&lt;BR /&gt;OPEN(UNIT=FID,&lt;BR /&gt;file = FileName, &lt;BR /&gt;Status='REPLACE', &lt;BR /&gt;Access='Sequential', &lt;BR /&gt;Form='binary',&lt;BR /&gt;IOSTAT=IERR)&lt;BR /&gt;&lt;BR /&gt;The first record written to the file is the number of additional records that the program intends to write.  It is possible that during the course of processing, the actual number of records written is less than the number intended. &lt;BR /&gt;&lt;BR /&gt;In this instance, I am trying to update the first record with the correct number.  The rewind statement doesn't return an error and neither does the write.  However, after closing and opening the file with another program, the original value in the first record persists, the update is not apparent.  &lt;BR /&gt;Any takers?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 17 Jul 2003 00:14:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Binary-Files/m-p/797571#M36057</guid>
      <dc:creator>tlillys</dc:creator>
      <dc:date>2003-07-17T00:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Files</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Binary-Files/m-p/797572#M36058</link>
      <description>rewinding a file and then writing a record effectively deletes all previous data that existed or was just  written to a sequential file.&lt;BR /&gt;&lt;BR /&gt;you could close the file perserving your updates, then&lt;BR /&gt;open(1,file='test.dat',form='binary',access='direct',recl=4)&lt;BR /&gt;&lt;BR /&gt;read (1,rec=1) oldcount&lt;BR /&gt;newcount = oldcount+?&lt;BR /&gt;write (1,rec=1) newcount&lt;BR /&gt;close (1)</description>
      <pubDate>Thu, 17 Jul 2003 03:11:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Binary-Files/m-p/797572#M36058</guid>
      <dc:creator>dave_frank</dc:creator>
      <dc:date>2003-07-17T03:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Files</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Binary-Files/m-p/797573#M36059</link>
      <description>If you use direct access (which requires fixed-length records), you can rewrite individual records.  As Dave says, if you use sequential writes, all data following in the file becomes undefined.</description>
      <pubDate>Thu, 17 Jul 2003 03:34:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Binary-Files/m-p/797573#M36059</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2003-07-17T03:34:34Z</dc:date>
    </item>
  </channel>
</rss>

