title: Why writing to standard input works?
body: <p>I wrote to standard input and it appeared on screen (0 standard input, 1 standard output, 2 standard error</p>
  
  <pre><code>const int SIZE=12;
  
  int main()
  {
      int fd = open("input.txt", O_RDWR);
      char buffer[SIZE] = "Hello world";
      write(fd, buffer, SIZE - 1);
  
      lseek(fd, 0, SEEK_SET);
      char mem[SIZE];
      read(fd, mem, SIZE - 1);
      mem[SIZE] = '\0';
  
      write(0, mem, SIZE - 1);
      printf("\n");
      write(1, mem, SIZE - 1);
      printf("\n");
      write(2, mem, SIZE - 1);
      printf("\n");
  
      return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Hello world
  Hello world
  Hello world
  </code></pre>
  
  <p>How this works? Doesn't standard input connected to keyboard?</p>
  
  <p>Thanks.</p>