regular expressions with other string classes

Andrew Dalke dalke at dalkescientific.com
Wed Sep 19 14:52:27 EDT 2001


Nicholas FitzRoy-Dale:
>Actually, I just did a bit of testing, and it seems that it's the file
>length param that's causing that error - supplying 0 doesn't work. I
>initially supplied a very large file length and predictably got sigsegv
>or something when the re ran off the end of the file :-) so I actually
>supplied the correct length and it worked.

I used 0 since the docs say

> If length is 0, the maximum length of the map will be the
> current size of the file when mmap() is called.

but upon rereading the docs I see that's Windows specific, and
it says nothing about what 0 means when passed to the Unix call.

On unix, the implementation passes the size value, unmodified,
to the mmap(2) function.  The man page function doesn't mention
anything special about how it treats 0 size.

So I yet again misunderstood how the mmap module is supposed to
be used.  :(

I believe it needs better documentation.  I believe I don't
know enough about mmap to provide that documentation.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list