<?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: Shareable writing into file in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/shareable-writing-into-file/m-p/6224017#M37242</link>
    <description>&lt;P&gt;I've got some hurry with it. I've found the post with linked &lt;A target="_blank" href="https://community.hpe.com/t5/Languages-and-Scripting/POSIX-file-range-locking-problem/td-p/5852191"&gt;issue.&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If the problem and the solution is identical I'll delete this one.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2013 06:30:04 GMT</pubDate>
    <dc:creator>AlexanderM</dc:creator>
    <dc:date>2013-10-02T06:30:04Z</dc:date>
    <item>
      <title>Shareable writing into file</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/shareable-writing-into-file/m-p/6224007#M37241</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I need to write in a log file from several processes.&lt;/P&gt;&lt;P&gt;I am using the next &lt;A target="_blank" href="http://unixhelp.ed.ac.uk/CGI/man-cgi?open+2"&gt;solution&lt;/A&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;int logFile;
logFile = open(stampedPath.ptr, O_WRONLY | O_APPEND | O_CREAT, 0666);
write(logFile, buffer.ptr, buffer.len);//to achieve atomic output
close(logFile);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;In Linux(Red Hat) it works perfectly.&lt;/P&gt;&lt;P&gt;On OpenVMS I've got the next message in the second process: &lt;EM&gt;file currently locked by another user&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've read about &lt;STRONG&gt;fwrite&lt;/STRONG&gt; with additional keys from c language extension, but it is queit hard to find out in google full manual for this keys.&lt;/P&gt;&lt;P&gt;Furthermore:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I am not shure that in this case family of &lt;STRONG&gt;printf&lt;/STRONG&gt; functions&amp;nbsp; will give atomic output (in Linux they allow for a processes to mix output).&lt;/LI&gt;&lt;LI&gt;I dont want to duplicate the code.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Could I resolve this situation with &lt;STRONG&gt;open&lt;/STRONG&gt;/&lt;STRONG&gt;write&lt;/STRONG&gt;/&lt;STRONG&gt;close&lt;/STRONG&gt; using?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2013 06:22:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/shareable-writing-into-file/m-p/6224007#M37241</guid>
      <dc:creator>AlexanderM</dc:creator>
      <dc:date>2013-10-02T06:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Shareable writing into file</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/shareable-writing-into-file/m-p/6224017#M37242</link>
      <description>&lt;P&gt;I've got some hurry with it. I've found the post with linked &lt;A target="_blank" href="https://community.hpe.com/t5/Languages-and-Scripting/POSIX-file-range-locking-problem/td-p/5852191"&gt;issue.&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If the problem and the solution is identical I'll delete this one.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2013 06:30:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/shareable-writing-into-file/m-p/6224017#M37242</guid>
      <dc:creator>AlexanderM</dc:creator>
      <dc:date>2013-10-02T06:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shareable writing into file</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/shareable-writing-into-file/m-p/6224129#M37243</link>
      <description>&lt;P&gt;solution&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;logFile = open(stampedPath.ptr, O_WRONLY | O_APPEND | O_CREAT, 0666&lt;BR /&gt;#ifdef VAX&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,"shr = del, get, put, upd", "ctx = stm", "ctx = bin"&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2013 07:52:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/shareable-writing-into-file/m-p/6224129#M37243</guid>
      <dc:creator>AlexanderM</dc:creator>
      <dc:date>2013-10-02T07:52:34Z</dc:date>
    </item>
  </channel>
</rss>

