]> granicus.if.org Git - python/commitdiff
#2768: add a note on how to get a file descriptor.
authorGeorg Brandl <georg@python.org>
Fri, 2 Apr 2010 08:39:09 +0000 (08:39 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 2 Apr 2010 08:39:09 +0000 (08:39 +0000)
Doc/library/os.rst

index 43d029a93f2a37c4be15194f399ff69aac749afc..b4e39a425d78ff01fd149105b7757513a451d840 100644 (file)
@@ -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)