title: Can I get a callback / do I know when SQLite has created write-ahead log files? I want to chmod them
body: <p>I have an elevated process and I want to make sure the SQLite files that it creates are readable by other processes. For some reason <code>umask</code> doesn't seem to do what I want (set permissions of sqlite file created by process).</p>
  
  <p>I'm using write-ahead logging, so <code>-wal</code> and <code>-shm</code> files are created in addition to the database file. I want all 3 to be chmodded correctly.</p>
  
  <p>I wonder if it's possible to get in after the SQLite file is created and <code>chmod</code> it.</p>
  
  <p>Possible approaches:</p>
  
  <ol>
  <li><code>touch</code> all 3 files before SQLite tries to create them, then chmod and hope the mask stays the same</li>
  <li>Intercept when the files are created and <code>chmod</code> them. </li>
  <li>Work out how to get <code>umask</code> to work for the process.</li>
  <li>Mystery option four.</li>
  </ol>
  
  <p>What's the best way to go?</p>
  
  <p>Questions for approaches:</p>
  
  <ol>
  <li>Will SQLite be OK with this?</li>
  <li>Do we know when all 3 files are created? Is there some kind of callback I can give a function pointer to? Do we know if the same <code>wal</code> and <code>shm</code> files are around forever? Or are they deleted and re-created?</li>
  </ol>