title: Write my own 'everything is a file' interface
body: <p>I would like to expose the settings and statistics of my program in a 'everything is a file' manner - sort of how /proc/ and /sys/ works. </p>
  
  <p>As an example, imagine for a moment that apache2 had this type of interface. You would then be able to do something like this (hypothetical):</p>
  
  <pre><code>cd /apache2/virtual_hosts
  mkdir 172.20.30.50
  cd 172.20.30.50
  echo '/www/example1' &gt; DocumentRoot
  echo 'www.example1.com' &gt; ServerName
  echo 1 &gt; control/enabled
  cat control/status
     enabled true
     uptime 4080
     hits 0
  </code></pre>
  
  <p>Now, are there any tutorials or similar on how to do this? I'm mainly looking for techniques for 'pretending to be a file or dir'. I'm on linux, POSIX or other more portable method would be preferable, but not required.</p>