<?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>MQX Software SolutionsのトピックRe: 2 FILE fopen on same file</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-FILE-fopen-on-same-file/m-p/292189#M9375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Lucky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am afraid that this approach would not work reliably even if the flushing is performed after the write.&lt;/P&gt;&lt;P&gt;Current design of MFS simply does not allow this. I am even surprised that you were successfully able to open the file the second time at all, if it was already open for writing. A file may be opened multiple times, but only for reading.&lt;/P&gt;&lt;P&gt;If you need to use producer/consumer model like a pipe I suggest you looking at MQX IPC (message queues might also suit well).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jul 2013 13:29:47 GMT</pubDate>
    <dc:creator>pavel_chromy</dc:creator>
    <dc:date>2013-07-03T13:29:47Z</dc:date>
    <item>
      <title>2 FILE fopen on same file</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-FILE-fopen-on-same-file/m-p/292187#M9373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to open 2 FILE (fopen) on same path:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A task will fopen FILE for writing in append mode (producer)&lt;/LI&gt;&lt;LI&gt;A second task will open same path to read written data from (consumer)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems not to work. Consumer always reads EOF in spite of producer writes in the file.&lt;/P&gt;&lt;P&gt;If producer closes the file, then it seems to work. But, this is not realtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have MQX 4.0 (not 4.01), on Kinetis K60 custom board.&lt;/P&gt;&lt;P&gt;MFS device is SD card.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would this application be possible ?&lt;/P&gt;&lt;P&gt;Some idea ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 13:29:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-FILE-fopen-on-same-file/m-p/292187#M9373</guid>
      <dc:creator>lucky06200</dc:creator>
      <dc:date>2013-06-14T13:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: 2 FILE fopen on same file</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-FILE-fopen-on-same-file/m-p/292188#M9374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe, when read and write the same file on the file system, a flush operation is often required because there is only one buffer used for read and write. When the producer closes the file, a flush operation is done. You may try&amp;nbsp; _io_fflush() first&amp;nbsp; detailed on the MQX MFS user guide page 24 whenever you do a read operation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 08:27:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-FILE-fopen-on-same-file/m-p/292188#M9374</guid>
      <dc:creator>zhiyangzhang</dc:creator>
      <dc:date>2013-07-03T08:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: 2 FILE fopen on same file</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/2-FILE-fopen-on-same-file/m-p/292189#M9375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Lucky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am afraid that this approach would not work reliably even if the flushing is performed after the write.&lt;/P&gt;&lt;P&gt;Current design of MFS simply does not allow this. I am even surprised that you were successfully able to open the file the second time at all, if it was already open for writing. A file may be opened multiple times, but only for reading.&lt;/P&gt;&lt;P&gt;If you need to use producer/consumer model like a pipe I suggest you looking at MQX IPC (message queues might also suit well).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 13:29:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/2-FILE-fopen-on-same-file/m-p/292189#M9375</guid>
      <dc:creator>pavel_chromy</dc:creator>
      <dc:date>2013-07-03T13:29:47Z</dc:date>
    </item>
  </channel>
</rss>

