Proposed extension to file constructor

Skip Montanaro skip at pobox.com
Tue Jun 3 15:40:28 EDT 2003


    taral> I needed to extend popen functionality, so I modified the file
    taral> constructor to optionally take a file descriptor. It was, in my
    taral> opinion, the minimum way to do it while preserving isinstance(x,
    taral> file).

Where are you getting file descriptors?  What's wrong with using os.fdopen
to wrap a file descriptor in a file object?

    fdopen(...)
        fdopen(fd [, mode='r' [, bufsize]]) -> file_object

        Return an open file object connected to a file descriptor.

Skip





More information about the Python-list mailing list