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
0ed66344
Commit
0ed66344
authored
Apr 16, 2004
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
really scream out that people should use the file objects instead of
file descriptor operations for normal applications
parent
c00fc845
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
Doc/lib/libos.tex
Doc/lib/libos.tex
+19
-7
No files found.
Doc/lib/libos.tex
View file @
0ed66344
...
...
@@ -399,11 +399,13 @@ using file descriptors.
Close file descriptor
\var
{
fd
}
.
Availability: Macintosh,
\UNIX
, Windows.
Note: this function is intended for low-level I/O and must be applied
\begin{notice}
This function is intended for low-level I/O and must be applied
to a file descriptor as returned by
\function
{
open()
}
or
\function
{
pipe()
}
. To close a ``file object'' returned by the
built-in function
\function
{
open()
}
or by
\function
{
popen()
}
or
\function
{
fdopen()
}
, use its
\method
{
close()
}
method.
\end{notice}
\end{funcdesc}
\begin{funcdesc}
{
dup
}{
fd
}
...
...
@@ -498,10 +500,12 @@ For a description of the flag and mode values, see the C run-time
documentation; flag constants (like
\constant
{
O
_
RDONLY
}
and
\constant
{
O
_
WRONLY
}
) are defined in this module too (see below).
Note: this function is intended for low-level I/O. For normal usage,
\begin{notice}
This function is intended for low-level I/O. For normal usage,
use the built-in function
\function
{
open()
}
, which returns a ``file
object'' with
\method
{
read()
}
and
\method
{
write()
}
methods (and many
more).
\end{notice}
\end{funcdesc}
\begin{funcdesc}
{
openpty
}{}
...
...
@@ -525,12 +529,14 @@ referred to by \var{fd} has been reached, an empty string is
returned.
Availability: Macintosh,
\UNIX
, Windows.
Note: this function is intended for low-level I/O and must be applied
\begin{notice}
This function is intended for low-level I/O and must be applied
to a file descriptor as returned by
\function
{
open()
}
or
\function
{
pipe()
}
. To read a ``file object'' returned by the
built-in function
\function
{
open()
}
or by
\function
{
popen()
}
or
\function
{
fdopen()
}
, or
\code
{
sys.stdin
}
, use its
\method
{
read()
}
or
\method
{
readline()
}
methods.
\end{notice}
\end{funcdesc}
\begin{funcdesc}
{
tcgetpgrp
}{
fd
}
...
...
@@ -558,12 +564,14 @@ Write the string \var{str} to file descriptor \var{fd}.
Return the number of bytes actually written.
Availability: Macintosh,
\UNIX
, Windows.
Note: this function is intended for low-level I/O and must be applied
\begin{notice}
This function is intended for low-level I/O and must be applied
to a file descriptor as returned by
\function
{
open()
}
or
\function
{
pipe()
}
. To write a ``file object'' returned by the
built-in function
\function
{
open()
}
or by
\function
{
popen()
}
or
\function
{
fdopen()
}
, or
\code
{
sys.stdout
}
or
\code
{
sys.stderr
}
, use
its
\method
{
write()
}
method.
\end{notice}
\end{funcdesc}
...
...
@@ -874,10 +882,12 @@ Works like \function{rename()}, except creation of any intermediate
directories needed to make the new pathname good is attempted first.
After the rename, directories corresponding to rightmost path segments
of the old name will be pruned away using
\function
{
removedirs()
}
.
\versionadded
{
1.5.2
}
Note: this function can fail with the new directory structure made if
\begin{notice}
This function can fail with the new directory structure made if
you lack permissions needed to remove the leaf directory or file.
\
versionadded
{
1.5.2
}
\
end{notice
}
\end{funcdesc}
\begin{funcdesc}
{
rmdir
}{
path
}
...
...
@@ -1228,9 +1238,11 @@ Exit to the system with status \var{n}, without calling cleanup
handlers, flushing stdio buffers, etc.
Availability:
\UNIX
, Windows.
Note: the standard way to exit is
\code
{
sys.exit(
\var
{
n
}
)
}
.
\begin{notice}
The standard way to exit is
\code
{
sys.exit(
\var
{
n
}
)
}
.
\function
{_
exit()
}
should normally only be used in the child process
after a
\function
{
fork()
}
.
\end{notice}
\end{funcdesc}
The following exit codes are a defined, and can be used with
...
...
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