<?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 Re: Open, Write, &amp; Read in WIN32 program in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798927#M36701</link>
    <description>&lt;DIV&gt;Steve, thank youfor the info.&lt;/DIV&gt;</description>
    <pubDate>Thu, 23 Sep 2004 19:12:37 GMT</pubDate>
    <dc:creator>ahasan</dc:creator>
    <dc:date>2004-09-23T19:12:37Z</dc:date>
    <item>
      <title>Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798919#M36693</link>
      <description>&lt;DIV&gt;Are there any restrictionproblems&amp;#8;ugs for using Open, Write, and Read statements in a Fortran WIN32 program. More specifically, I would like to use theB edit descriptor toRead and Writefloating point numbersto direct access binary files. &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I remember reading somewhere that there may be some restrictions/problems doing this, but can't remember where Isaw that, or maybe my memory is incorrect!&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks for any information.&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Sep 2004 19:56:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798919#M36693</guid>
      <dc:creator>ahasan</dc:creator>
      <dc:date>2004-09-20T19:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798920#M36694</link>
      <description>&lt;DIV&gt;There are no restrictions whatsoever, except that Win32 applications do not have a console by default, so WRITE(*) and READ(*) won't work unless the console is created via AllocConsole or I/O redirected via SetStdHandle.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Sep 2004 21:35:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798920#M36694</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-09-20T21:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798921#M36695</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Well, if you plan on writing/using code in a Windows environment for any length of time, you might consider using Win32 file API calls instead of native Fortran. Doing so makes your code Win32-specific and thus not portable, but the performance is MUCH better than any native Fortran i/o, and from a programming point of view, especially if you plan on extensive binary i/o, much more convenient and "natural". Basically, you can set a file pointer to any byte offset within a file, and read/write from/to any structure in memory, eg,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;B&gt;&lt;FONT color="#0000ff"&gt;
&lt;P&gt;INTEGER&lt;/P&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt;, &lt;B&gt;&lt;FONT color="#0000ff"&gt;PARAMETER&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt; :: npoints = some_large_number&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT color="#0000ff"&gt;REAL&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt;, &lt;B&gt;&lt;FONT color="#0000ff"&gt;DIMENSION&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt;(npoints) :: myarray&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;! get the data from a saved file (using Win32 functions in module)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;ihandl = open_the_file ("c:data	emparray.dat"//&lt;FONT color="#0000ff"&gt;CHAR&lt;/FONT&gt;(0), 'R')&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT color="#0000ff"&gt;IF&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt; (ihandl &amp;gt; 0) &lt;B&gt;&lt;FONT color="#0000ff"&gt;THEN&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT color="#0000ff"&gt;CALL&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt; rw_file ('R', ihandl, npoints*&lt;FONT color="#0000ff"&gt;SIZEOF&lt;/FONT&gt;(myarray(1)), &lt;FONT color="#0000ff"&gt;LOC&lt;/FONT&gt;(myarray(1)))&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT color="#0000ff"&gt;CALL&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt; close_file (ihandl)&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT color="#0000ff"&gt;END IF&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;DIV&gt;The att. module provides the details.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Sep 2004 06:42:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798921#M36695</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2004-09-21T06:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798922#M36696</link>
      <description>&lt;DIV&gt;Second try for attachment...&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Sep 2004 06:45:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798922#M36696</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2004-09-21T06:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798923#M36697</link>
      <description>&lt;DIV&gt;Thanks for the replies, and I will take a good look at the example code. Probably have some additional questions. Again, thanks.&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Sep 2004 08:03:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798923#M36697</guid>
      <dc:creator>ahasan</dc:creator>
      <dc:date>2004-09-21T08:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798924#M36698</link>
      <description>&lt;DIV&gt;Paul, could you provide some benchmarking/samples to prove your point? I don'tthink that there would be asignificant overhead of Fortran I/O library comparedto native API calls, but I'm open-minded if you could prove otherwise. (Of course, if you measure only binary or unformatted files -- formatted ones have inherent overhead).&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Sep 2004 14:38:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798924#M36698</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-09-21T14:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798925#M36699</link>
      <description>&lt;DIV&gt;Paul, I did look at your sample code then wrote a simple program to write and read one real number using WriteFile and ReadFile. Very straight forward, just point at the real variable and write 4 bytes.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;JugoSlavDujic and Paul, I noticed that theFortram Write statementusing the B edit descriptor appears to convert areal number into 32 ASCI 1s and Os (using Notepad to look at the file) rather than simply writing 4 bytes of binary to the file. So it takes 32 bytes to represent a real number rather than 4. Is this correct or am I missing something. Thanks! &lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Sep 2004 19:56:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798925#M36699</guid>
      <dc:creator>ahasan</dc:creator>
      <dc:date>2004-09-22T19:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798926#M36700</link>
      <description>&lt;DIV&gt;That is correct - that's what formatted output does. Formatted output is always going to be slower than direct binary writes, as conversion is done. You can use A format with formatted if you want to just copy bits of a numeric, but you will have difficulty reading such files with formatted I/O as certain numbers will be misinterpreted as record delimiters.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Use FORM='UNFORMATTED' or FORM='BINARY' for binary I/O. (The latter has no record structure.)&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Sep 2004 20:03:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798926#M36700</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-09-22T20:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Open, Write, &amp; Read in WIN32 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798927#M36701</link>
      <description>&lt;DIV&gt;Steve, thank youfor the info.&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Sep 2004 19:12:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Open-Write-Read-in-WIN32-program/m-p/798927#M36701</guid>
      <dc:creator>ahasan</dc:creator>
      <dc:date>2004-09-23T19:12:37Z</dc:date>
    </item>
  </channel>
</rss>

