title: open function in c can't find a file when the file name is written with its directory
body: <p>The open function works fine when I try to open a file in the current directory but if I mention the directory of the file with its name as a parameter in the open function, the file is not found error happens. Also, when i try to open a file in another directory with the open function, the terminal prints there is no such file or directory. I can't find what is the problem with writing the directory of the file.</p>
  
  <p>Right now I'm working in 'child1' directory and I want to open 'openthis.c' file. This is the code I want to execute.</p>
  
  <pre><code>#include&lt;fcntl.h&gt;
  #include&lt;stdlib.h&gt;
  #include&lt;sys/stat.h&gt;
  int main(){
  int fd;
  if((fd = open("/child1/openthis.c", O_RDONLY) &lt; 0){
  perror("open");
  exit(1);}
  return 0;
  }
  </code></pre>
  
  <p>This doesn't work but if I write</p>
  
  <pre><code>open("openthis.c", O_RDONLY)
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>open("/child1/openthis.c", O_RDONLY)
  </code></pre>
  
  <p>the code works fine. Why do you think every time I write the directory of the file, the file is not found?</p>