How can I modify a file while other threads read from it?
<p>I'm multithreading data (both reading and writing) into/from a <em>single</em> text file.
I need to be able to replace or remove text from this file <em>without</em> replacing the actual file.</p>

<p>I cannot simply <code>.read()</code> into a string, then <code>.write()</code> a new file with the same name, because other threads are still using that file. I cannot <code>.write()</code> into a different file because threads need to <code>.read()</code> from this <em>single</em> file.</p>

<p>Is this possible?</p>

<p>Is there something equivalent to <code>file.replace()</code> or <code>file.remove()</code> or <code>file.delete()</code>?</p>
