title: open file with O_CREAT|O_RDWR will cause the file to be write only
body: <p>In my c code I write to afile using <code>open()</code> with option <code>O_CREAT|O_RDWR</code> and then <code>write()</code>:</p>
  
  <pre><code>    readfd = open("ak.bin", O_CREAT|O_RDWR);
      if (readfd &gt;= 0) {
          res = write(readfd, key, 16);
          close(readfd);
      }
  </code></pre>
  
  <p>after executing my program I found that the file <code>"ak.bin"</code> is with write permission only. I can not read it!</p>
  
  <pre><code>$ ls -l | grep ak
  -----w---- 1 mohamed mohamed     16 Jun  3 18:30 ak.bin
  </code></pre>
  
  <p>What I m missing? I want my file to be readeable also.</p>