Hi<br><br>On 8/9/07, <b class="gmail_sendername">Eduardo Schettino</b> &lt;<a href="mailto:schettino72@gmail.com">schettino72@gmail.com</a>&gt; wrote:<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br> Is there an asynchronous wrapper for local file system operation<br>(i.e. write a file to disk)?</blockquote><div><br>I don&#39;t think there is anything that works out of the box. I think there is a python wrapper for posix aio somewhere, but AFAIK it is not integrated into twisted in any way.&nbsp;&nbsp;
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> And I guess using deferToThread is not the right approach for I/O operations.<br>
</blockquote></div><br>Usually writes take _very_ little time. The data is only copied to kernel space and control is returned. The data is then written to disk later. Reading will probably be a bit more problematic, but it will still take little time compared to (common) network IO.
<br><br>I suggest starting with just doing writes and reads directly and if it becomes a problem, then start to solve it. You can create a small file wrapper which returns a defer (just use return defer.succeed() and then change the implementation if it becomes necessary.
<br><br>-- <br>&nbsp;&nbsp; - Henrik