title: system call to write and read from a file
body: <p>I want to test the system call of <code>read</code> and <code>write</code></p>
  
  <pre><code>#include &lt;unistd.h&gt;
  #include &lt;fcntl.h&gt;
  
  int main(void)
  {
      fd = open("/Users/me/Desktop/PubRepo/C/APUE/3.File_IO/test", O_RDWR);
      write(fd, "Test the first line",20);
  }
  </code></pre>
  
  <p>The cc reports:</p>
  
  <pre><code>In [29]: !cc write_test.c                                                                                         
  write_test.c:6:5: error: use of undeclared identifier 'fd'
      fd = open("/Users/me/Desktop/PubRepo/C/APUE/3.File_IO/test", O_RDWR);
      ^
  write_test.c:7:11: error: use of undeclared identifier 'fd'
      write(fd, "Test the first line",20)
            ^
  2 errors generated.
  </code></pre>
  
  <p>I have some python basics, but have no idea how to get the code done.</p>