<?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 exclusive access on files in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/exclusive-access-on-files/m-p/3622664#M104722</link>
    <description>Is there any way in C to open a file (on HP-UX) having an exclusive access for writing?&lt;BR /&gt;I mean I have just one process that have to write in this file while other programs can only read. Is it possible?&lt;BR /&gt;On other Unix flavour there is the flag “O_RSHARE” for the “open” api. On HP?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
    <pubDate>Fri, 09 Sep 2005 10:02:34 GMT</pubDate>
    <dc:creator>Marco Salvi</dc:creator>
    <dc:date>2005-09-09T10:02:34Z</dc:date>
    <item>
      <title>exclusive access on files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exclusive-access-on-files/m-p/3622664#M104722</link>
      <description>Is there any way in C to open a file (on HP-UX) having an exclusive access for writing?&lt;BR /&gt;I mean I have just one process that have to write in this file while other programs can only read. Is it possible?&lt;BR /&gt;On other Unix flavour there is the flag “O_RSHARE” for the “open” api. On HP?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Sep 2005 10:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exclusive-access-on-files/m-p/3622664#M104722</guid>
      <dc:creator>Marco Salvi</dc:creator>
      <dc:date>2005-09-09T10:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: exclusive access on files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exclusive-access-on-files/m-p/3622665#M104723</link>
      <description>There is no direct equivalent but you can use&lt;BR /&gt;lockf() or fcntl() to do this. If you set the setgid bit on the data file then the locks become mandatory rather than advisory.&lt;BR /&gt;A far simpler solution and one that would be portable across all flavors of UNIX is to set the permissions to 640 or 644 and the "writer" process would have the effective UID of the owner of the file.</description>
      <pubDate>Fri, 09 Sep 2005 10:32:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exclusive-access-on-files/m-p/3622665#M104723</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-09-09T10:32:24Z</dc:date>
    </item>
  </channel>
</rss>

