summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-06-23 09:07:03 (GMT)
committerGuido van Rossum <guido@python.org>1992-06-23 09:07:03 (GMT)
commited233a56963233bbd646fdac01e55c9fdec50a30 (patch)
tree590cee6874280421f9288568015bf9b30326b8ed /Objects
parent5dc8eb0914a6fcea604a6626af9e63120e84b527 (diff)
downloadcpython-ed233a56963233bbd646fdac01e55c9fdec50a30.zip
cpython-ed233a56963233bbd646fdac01e55c9fdec50a30.tar.gz
cpython-ed233a56963233bbd646fdac01e55c9fdec50a30.tar.bz2
Changes for new UNIX-specific built-in module 'select' and new header for
interfaces to variants of select() system call, "myselect.h". This includes adding fileno() methods to files, sockets and stdwin.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/fileobject.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 47461f9..76bcad4 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -222,6 +222,16 @@ file_tell(f, args)
}
static object *
+file_fileno(f, args)
+ fileobject *f;
+ object *args;
+{
+ if (!getnoarg(args))
+ return NULL;
+ return newintobject((long) fileno(f->f_fp));
+}
+
+static object *
file_flush(f, args)
fileobject *f;
object *args;
@@ -462,6 +472,7 @@ file_write(f, args)
static struct methodlist file_methods[] = {
{"close", file_close},
{"flush", file_flush},
+ {"fileno", file_fileno},
{"isatty", file_isatty},
{"read", file_read},
{"readline", file_readline},