title: sorted glob in C/linux
body: <p>I need to find the latest created/modified files in a directory. Basically what <code>ls -t *.bla</code> does. In C, not PHP, so this question does not help me - 
  <a href="https://stackoverflow.com/questions/124958/glob-sort-by-date">glob() - sort by date</a></p>
  
  <hr>
  
  <p>This is an example of what no to do (forking a process is not cheap, it's lazy):</p>
  
  <pre><code>char filename[100];
  FILE *f = popen("ls -1t /*.blabla");
  fscanf(f, "%s", filename);
  pclose(f);
  </code></pre>
  
  <p>?</p>