fileno()

Aahz Maruch aahz at panix.com
Mon Sep 18 12:01:19 EDT 2000


In article <8q5ako$9uj$1 at news.uit.no>,
Arild Hansen <arildh at stud.cs.uit.no> wrote:
>
>What is the exact purpose of fileno()? I keep searching for a good
>explanation of this function returning a file handler to an object,
>but what is the precise meaning and purpose of this? All help greatly
>appreciated !

As it says in the docs, it's for low-level access to file objects.  For
example, suppose you open a file in Python and want to access that file
in a C extension; you'd need to pass in f.fileno().  (There are
mechanisms for doing Pythonic access to the file in C, but it's a lot
simpler to just get the file handle.)
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

The best way to get information on Usenet is not to ask a question, but 
to post the wrong information.  --Aahz



More information about the Python-list mailing list