Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0adfb45b
Commit
0adfb45b
authored
Jun 18, 2000
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make changes and clarifications suggested by Mark Hammond
parent
b081e180
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
Doc/lib/libmmap.tex
Doc/lib/libmmap.tex
+23
-14
No files found.
Doc/lib/libmmap.tex
View file @
0adfb45b
...
...
@@ -19,17 +19,24 @@ different on Unix and on Windows.
\begin{funcdesc}
{
mmap
}{
fileno, length
\optional
{
, tagname
}
}
(Windows version) Maps
\var
{
length
}
bytes from the file specified by
the file handle
\var
{
fileno
}
, and returns a mmap object. If you have
a Python file object, its
\method
{
fileno()
}
method returns the file's handle, which is just an integer.
\var
{
tagname
}
, if specified, is a string giving a tag name for the mapping. XXX what is the purpose of the tag name?
the file handle
\var
{
fileno
}
, and returns a mmap object. If you wish
to map an existing Python file object, use its
\method
{
fileno()
}
method to obtain the correct value for the
\var
{
fileno
}
parameter.
\var
{
tagname
}
, if specified, is a string giving a tag name for the mapping.
Windows allows you to have many different mappings against the same
file. If you specify the name of an existing tag, that tag is opened,
otherwise a new tag of this name is created. If this parameter is
None, the mapping is created without a name. Avoiding the use of the
tag parameter will assist in keeping your code portable between Unix
and Windows.
\end{funcdesc}
\begin{funcdesc}
{
mmap
}{
file, size
\optional
{
, flags, prot
}}
\begin{funcdesc}
{
mmap
}{
file
no
, size
\optional
{
, flags, prot
}}
(Unix version) Maps
\var
{
length
}
bytes from the file specified by the
file handle
\var
{
fileno
}
, and returns a mmap object. If you
have a
Python file object, its
\method
{
fileno()
}
method returns the file's
handle, which is just an integ
er.
file handle
\var
{
fileno
}
, and returns a mmap object. If you
wish to
map an existing Python file object, use its
\method
{
fileno()
}
method
to obtain the correct value for the
\var
{
fileno
}
paramet
er.
\var
{
flags
}
specifies the nature of the mapping.
\code
{
MAP
_
PRIVATE
}
creates a private copy-on-write mapping, so
...
...
@@ -61,8 +68,10 @@ will result in an exception being raised.
\begin{methoddesc}
{
flush
}{
\optional
{
\var
{
offset
}
,
\var
{
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
\var
{
offset
}
and
\var
{
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.
written back before the object is destroyed. If
\var
{
offset
}
and
\var
{
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.
\end{methoddesc}
\begin{methoddesc}
{
move
}{
\var
{
dest
}
,
\var
{
src
}
,
\var
{
count
}}
...
...
@@ -71,14 +80,14 @@ to the destination index \var{dest}.
\end{methoddesc}
\begin{methoddesc}
{
read
}{
\var
{
num
}}
Return a string containing up to
\var
{
num
}
bytes
taken
from the
Return a string containing up to
\var
{
num
}
bytes
starting
from the
current file position; the file position is updated to point after the
bytes that were returned.
\end{methoddesc}
\begin{methoddesc}
{
read
_
byte
}{}
Returns
the character at the current file position, and advancing
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.
\end{methoddesc}
\begin{methoddesc}
{
readline
}{}
...
...
@@ -113,7 +122,7 @@ bytes that were written.
\end{methoddesc}
\begin{methoddesc}
{
write
_
byte
}{
\var
{
byte
}}
Write
\var
{
byte
}
into memory at the current position of
Write
the single-character string
\var
{
byte
}
into memory at the current position of
the file pointer; the file position is advanced by 1.
\end{methoddesc}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment