On Wed, Jun 10, 2009 at 12:34 AM, Matthew Brett <span dir="ltr"><<a href="mailto:matthew.brett@gmail.com">matthew.brett@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<div class="im"><br>
> I am having problem while trying to memory map a simple file (attached as<br>
> test.txt)<br>
<br>
</div>The file looks like a text file, but memmap is for binary files.<br>
Could that be the problem?<br>
<br>
Best,<br>
<br>
Matthew</blockquote><div><br>What's the reason again that memmap only works with binary files? Could the functionality be extended to text files as well?<br><br>Python's mmap module support text file mapping, however I am getting another error this time :(<br>
<br>In [1]: import mmap<br><br>In [2]: f = open('test.txt', 'r')<br><br>In [3]: map = mmap.mmap(f.fileno(), 0)<br>---------------------------------------------------------------------------<br>EnvironmentError                          Traceback (most recent call last)<br>
<br>/home/gsever/Desktop/src/range_calc/<ipython console> in <module>()<br><br>EnvironmentError: [Errno 13] Permission denied<br><br><br>I am on a Linux machine...<br><br>gs  <br></div></div><br>