summaryrefslogtreecommitdiffstats
path: root/Doc/library/mmap.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-04-25 01:59:09 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-04-25 01:59:09 (GMT)
commite41251e864e94885d785b5a9bf8f824753316296 (patch)
treef530db7682d71f4920b22b8d7f84c89727647ab5 /Doc/library/mmap.rst
parent768db92b438038586c1580b711c528363a97d3f4 (diff)
downloadcpython-e41251e864e94885d785b5a9bf8f824753316296.zip
cpython-e41251e864e94885d785b5a9bf8f824753316296.tar.gz
cpython-e41251e864e94885d785b5a9bf8f824753316296.tar.bz2
Merged revisions 62490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62490 | benjamin.peterson | 2008-04-24 20:29:10 -0500 (Thu, 24 Apr 2008) | 2 lines reformat some documentation of classes so methods and attributes are under the class directive ........
Diffstat (limited to 'Doc/library/mmap.rst')
-rw-r--r--Doc/library/mmap.rst124
1 files changed, 62 insertions, 62 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index 0361320..4828935 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -131,111 +131,111 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
map.close()
-Memory-mapped file objects support the following methods:
+ Memory-mapped file objects support the following methods:
-.. method:: mmap.close()
+ .. method:: close()
- Close the file. Subsequent calls to other methods of the object will
- result in an exception being raised.
+ Close the file. Subsequent calls to other methods of the object will
+ result in an exception being raised.
-.. method:: mmap.find(string[, start[, end]])
+ .. method:: find(string[, start[, end]])
- Returns the lowest index in the object where the substring *string* is
- found, such that *string* is contained in the range [*start*, *end*].
- Optional arguments *start* and *end* are interpreted as in slice notation.
- Returns ``-1`` on failure.
+ Returns the lowest index in the object where the substring *string* is
+ found, such that *string* is contained in the range [*start*, *end*].
+ Optional arguments *start* and *end* are interpreted as in slice notation.
+ Returns ``-1`` on failure.
-.. method:: mmap.flush([offset, size])
+ .. method:: flush([offset, size])
- Flushes changes made to the in-memory copy of a file back to disk. Without
- use of this call there is no guarantee that changes are written back before
- the object is destroyed. If *offset* and *size* are specified, only
- changes to the given range of bytes will be flushed to disk; otherwise, the
- whole extent of the mapping is flushed.
+ Flushes changes made to the in-memory copy of a file back to disk. Without
+ use of this call there is no guarantee that changes are written back before
+ the object is destroyed. If *offset* and *size* are specified, only
+ changes to the given range of bytes will be flushed to disk; otherwise, the
+ whole extent of the mapping is flushed.
- **(Windows version)** A nonzero value returned indicates success; zero
- indicates failure.
+ **(Windows version)** A nonzero value returned indicates success; zero
+ indicates failure.
- **(Unix version)** A zero value is returned to indicate success. An
- exception is raised when the call failed.
+ **(Unix version)** A zero value is returned to indicate success. An
+ exception is raised when the call failed.
-.. method:: mmap.move(dest, src, count)
+ .. method:: move(dest, src, count)
- Copy the *count* bytes starting at offset *src* to the destination index
- *dest*. If the mmap was created with :const:`ACCESS_READ`, then calls to
- move will throw a :exc:`TypeError` exception.
+ Copy the *count* bytes starting at offset *src* to the destination index
+ *dest*. If the mmap was created with :const:`ACCESS_READ`, then calls to
+ move will throw a :exc:`TypeError` exception.
-.. method:: mmap.read(num)
+ .. method:: read(num)
- Return a string containing up to *num* bytes starting from the current file
- position; the file position is updated to point after the bytes that were
- returned.
+ Return a string containing up to *num* bytes starting from the current
+ file position; the file position is updated to point after the bytes that
+ were returned.
-.. method:: mmap.read_byte()
+ .. method:: read_byte()
- Returns a string of length 1 containing the character at the current file
- position, and advances the file position by 1.
+ Returns a string of length 1 containing the character at the current file
+ position, and advances the file position by 1.
-.. method:: mmap.readline()
+ .. method:: readline()
- Returns a single line, starting at the current file position and up to the
- next newline.
+ Returns a single line, starting at the current file position and up to the
+ next newline.
-.. method:: mmap.resize(newsize)
+ .. method:: resize(newsize)
- Resizes the map and the underlying file, if any. If the mmap was created
- with :const:`ACCESS_READ` or :const:`ACCESS_COPY`, resizing the map will
- throw a :exc:`TypeError` exception.
+ Resizes the map and the underlying file, if any. If the mmap was created
+ with :const:`ACCESS_READ` or :const:`ACCESS_COPY`, resizing the map will
+ throw a :exc:`TypeError` exception.
-.. method:: mmap.rfind(string[, start[, end]])
+ .. method:: rfind(string[, start[, end]])
- Returns the highest index in the object where the substring *string* is
- found, such that *string* is contained in the range [*start*, *end*].
- Optional arguments *start* and *end* are interpreted as in slice notation.
- Returns ``-1`` on failure.
+ Returns the highest index in the object where the substring *string* is
+ found, such that *string* is contained in the range [*start*, *end*].
+ Optional arguments *start* and *end* are interpreted as in slice notation.
+ Returns ``-1`` on failure.
-.. method:: mmap.seek(pos[, whence])
+ .. method:: seek(pos[, whence])
- Set the file's current position. *whence* argument is optional and
- defaults to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other
- values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position)
- and ``os.SEEK_END`` or ``2`` (seek relative to the file's end).
+ Set the file's current position. *whence* argument is optional and
+ defaults to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other
+ values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current
+ position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end).
-.. method:: mmap.size()
+ .. method:: size()
- Return the length of the file, which can be larger than the size of the
- memory-mapped area.
+ Return the length of the file, which can be larger than the size of the
+ memory-mapped area.
-.. method:: mmap.tell()
+ .. method:: tell()
- Returns the current position of the file pointer.
+ Returns the current position of the file pointer.
-.. method:: mmap.write(string)
+ .. method:: write(string)
- Write the bytes in *string* into memory at the current position of the file
- pointer; the file position is updated to point after the bytes that were
- written. If the mmap was created with :const:`ACCESS_READ`, then writing to
- it will throw a :exc:`TypeError` exception.
+ Write the bytes in *string* into memory at the current position of the
+ file pointer; the file position is updated to point after the bytes that
+ were written. If the mmap was created with :const:`ACCESS_READ`, then
+ writing to it will throw a :exc:`TypeError` exception.
-.. method:: mmap.write_byte(byte)
+ .. method:: write_byte(byte)
- Write the single-character string *byte* into memory at the current
- position of the file pointer; the file position is advanced by ``1``. If
- the mmap was created with :const:`ACCESS_READ`, then writing to it will
- throw a :exc:`TypeError` exception.
+ Write the single-character string *byte* into memory at the current
+ position of the file pointer; the file position is advanced by ``1``. If
+ the mmap was created with :const:`ACCESS_READ`, then writing to it will
+ throw a :exc:`TypeError` exception.