diff options
author | Georg Brandl <georg@python.org> | 2010-04-02 08:39:09 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-04-02 08:39:09 +0000 |
commit | 49b9192b12ab203bf6c1ec2e29f5b3d8ed3df684 (patch) | |
tree | 92b9e5e47da9f4fad6b5294b722446dc68435d8e | |
parent | 304b10ef22d81272e52366ef83e63044ee169b26 (diff) | |
download | cpython-git-49b9192b12ab203bf6c1ec2e29f5b3d8ed3df684.tar.gz |
#2768: add a note on how to get a file descriptor.
-rw-r--r-- | Doc/library/os.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 43d029a93f..b4e39a425d 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -513,6 +513,10 @@ process will then be assigned 3, 4, 5, and so forth. The name "file descriptor" is slightly deceptive; on Unix platforms, sockets and pipes are also referenced by file descriptors. +The :meth:`~file.fileno` method can be used to obtain the file descriptor +associated with a file object when required. Note that using the file +descriptor directly will bypass the file object methods, ignoring aspects such +as internal buffering of data. .. function:: close(fd) |