annotate Doc/libposixfile.tex @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents 6f032ea26642
children 683bc35ab753
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 % Manual text and implementation by Jaap Vermeulen
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 \section{Standard Module \sectcode{posixfile}}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 \bimodindex{posixfile}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 \indexii{posix}{file object}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
5
4406
6f032ea26642 Added embryonic description of fcntl.lockf(). Added pointer to that
Guido van Rossum <guido@python.org>
parents: 2647
diff changeset
6 \emph{Note:} This module will become obsolete in a future release.
6f032ea26642 Added embryonic description of fcntl.lockf(). Added pointer to that
Guido van Rossum <guido@python.org>
parents: 2647
diff changeset
7 The locking operation that it provides is done better and more
6f032ea26642 Added embryonic description of fcntl.lockf(). Added pointer to that
Guido van Rossum <guido@python.org>
parents: 2647
diff changeset
8 portably by the \code{fcntl.lockf()} call.
6f032ea26642 Added embryonic description of fcntl.lockf(). Added pointer to that
Guido van Rossum <guido@python.org>
parents: 2647
diff changeset
9
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 This module implements some additional functionality over the built-in
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 file objects. In particular, it implements file locking, control over
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 the file flags, and an easy interface to duplicate the file object.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 The module defines a new file object, the posixfile object. It
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
14 has all the standard file object methods and adds the methods
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
15 described below. This module only works for certain flavors of
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
16 \UNIX{}, since it uses \code{fcntl()} for file locking.
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
17
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 To instantiate a posixfile object, use the \code{open()} function in
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
19 the posixfile module. The resulting object looks and feels roughly
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
20 the same as a standard file object.
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
21
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 The posixfile module defines the following constants:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
23
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 \renewcommand{\indexsubitem}{(in module posixfile)}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 \begin{datadesc}{SEEK_SET}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 offset is calculated from the start of the file
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 \end{datadesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
28
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 \begin{datadesc}{SEEK_CUR}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 offset is calculated from the current position in the file
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 \end{datadesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
32
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 \begin{datadesc}{SEEK_END}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 offset is calculated from the end of the file
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 \end{datadesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
36
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 The posixfile module defines the following functions:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
38
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 \renewcommand{\indexsubitem}{(in module posixfile)}
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
40
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
41 \begin{funcdesc}{open}{filename\optional{\, mode\optional{\, bufsize}}}
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 Create a new posixfile object with the given filename and mode. The
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
43 \var{filename}, \var{mode} and \var{bufsize} arguments are
2578
0ac27ffd0579 micro change
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
44 interpreted the same way as by the built-in \code{open()} function.
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 \end{funcdesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
46
2064
280f31e6c653 copyright.tex: Add 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents: 1776
diff changeset
47 \begin{funcdesc}{fileopen}{fileobject}
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 Create a new posixfile object with the given standard file object.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
49 The resulting object has the same filename and mode as the original
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 file object.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
51 \end{funcdesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
52
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
53 The posixfile object defines the following additional methods:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
54
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
55 \renewcommand{\indexsubitem}{(posixfile method)}
1767
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
56 \begin{funcdesc}{lock}{fmt\, \optional{len\optional{\, start
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
57 \optional{\, whence}}}}
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 Lock the specified section of the file that the file object is
1767
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
59 referring to. The format is explained
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
60 below in a table. The \var{len} argument specifies the length of the
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
61 section that should be locked. The default is \code{0}. \var{start}
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
62 specifies the starting offset of the section, where the default is
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
63 \code{0}. The \var{whence} argument specifies where the offset is
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
64 relative to. It accepts one of the constants \code{SEEK_SET},
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 \code{SEEK_CUR} or \code{SEEK_END}. The default is \code{SEEK_SET}.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 For more information about the arguments refer to the fcntl
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
67 manual page on your system.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
68 \end{funcdesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
69
2647
9b7e6d9a528d typos, layout and other small things
Guido van Rossum <guido@python.org>
parents: 2578
diff changeset
70 \begin{funcdesc}{flags}{\optional{flags}}
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
71 Set the specified flags for the file that the file object is referring
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
72 to. The new flags are ORed with the old flags, unless specified
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
73 otherwise. The format is explained below in a table. Without
2647
9b7e6d9a528d typos, layout and other small things
Guido van Rossum <guido@python.org>
parents: 2578
diff changeset
74 the \var{flags} argument
9b7e6d9a528d typos, layout and other small things
Guido van Rossum <guido@python.org>
parents: 2578
diff changeset
75 a string indicating the current flags is returned (this is
1767
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
76 the same as the '?' modifier). For more information about the flags
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
77 refer to the fcntl manual page on your system.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
78 \end{funcdesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
79
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
80 \begin{funcdesc}{dup}{}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
81 Duplicate the file object and the underlying file pointer and file
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
82 descriptor. The resulting object behaves as if it were newly
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
83 opened.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
84 \end{funcdesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
85
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
86 \begin{funcdesc}{dup2}{fd}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
87 Duplicate the file object and the underlying file pointer and file
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
88 descriptor. The new object will have the given file descriptor.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
89 Otherwise the resulting object behaves as if it were newly opened.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
90 \end{funcdesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
91
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
92 \begin{funcdesc}{file}{}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
93 Return the standard file object that the posixfile object is based
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
94 on. This is sometimes necessary for functions that insist on a
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
95 standard file object.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
96 \end{funcdesc}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
97
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
98 All methods return \code{IOError} when the request fails.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
99
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
100 Format characters for the \code{lock()} method have the following meaning:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
101
1776
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
102 \begin{tableiii}{|c|l|c|}{samp}{Format}{Meaning}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
103 \lineiii{u}{unlock the specified region}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
104 \lineiii{r}{request a read lock for the specified section}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
105 \lineiii{w}{request a write lock for the specified section}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
106 \end{tableiii}
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
107
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
108 In addition the following modifiers can be added to the format:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
109
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
110 \begin{tableiii}{|c|l|c|}{samp}{Modifier}{Meaning}{Notes}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
111 \lineiii{|}{wait until the lock has been granted}{}
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
112 \lineiii{?}{return the first lock conflicting with the requested lock, or
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2064
diff changeset
113 \code{None} if there is no conflict.}{(1)}
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
114 \end{tableiii}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
115
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
116 Note:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
117
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
118 (1) The lock returned is in the format \code{(mode, len, start,
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
119 whence, pid)} where mode is a character representing the type of lock
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
120 ('r' or 'w'). This modifier prevents a request from being granted; it
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
121 is for query purposes only.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
122
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
123 Format character for the \code{flags()} method have the following meaning:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
124
1776
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
125 \begin{tableiii}{|c|l|c|}{samp}{Format}{Meaning}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
126 \lineiii{a}{append only flag}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
127 \lineiii{c}{close on exec flag}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
128 \lineiii{n}{no delay flag (also called non-blocking flag)}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
129 \lineiii{s}{synchronization flag}{}
5257af80e161 * Doc/libfuncs.tex: don't use $math$ in description of pow(x,y,z);
Guido van Rossum <guido@python.org>
parents: 1767
diff changeset
130 \end{tableiii}
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
131
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
132 In addition the following modifiers can be added to the format:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
133
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
134 \begin{tableiii}{|c|l|c|}{samp}{Modifier}{Meaning}{Notes}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
135 \lineiii{!}{turn the specified flags 'off', instead of the default 'on'}{(1)}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
136 \lineiii{=}{replace the flags, instead of the default 'OR' operation}{(1)}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
137 \lineiii{?}{return a string in which the characters represent the flags that
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
138 are set.}{(2)}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
139 \end{tableiii}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
140
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
141 Note:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
142
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
143 (1) The \code{!} and \code{=} modifiers are mutually exclusive.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
144
1767
907605320a5f Lots of small corrections by Andrew Kuchling (plus all new rotor docs)
Guido van Rossum <guido@python.org>
parents: 1644
diff changeset
145 (2) This string represents the flags after they may have been altered
1644
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
146 by the same call.
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
147
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
148 Examples:
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
149
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
150 \bcode\begin{verbatim}
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
151 from posixfile import *
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
152
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
153 file = open('/tmp/test', 'w')
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
154 file.lock('w|')
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
155 ...
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
156 file.lock('u')
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
157 file.close()
fa50d4bd5537 README: correct typo (lib.index)
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 \end{verbatim}\ecode