shared file access in python

Jeff Epler jepler at
Fri Jun 18 23:43:00 CEST 2004

The file() constructor probably takes any second argument that your OS's
fopen() does, though this may have changed with the creation of
universal newlines.

If there's something that can do that file() can't, you
should be able to achieve it by using os.fdopen(): (untested)
    def magic_file(filename, flag=os.O_RDONLY, mode='r', bufsize=None):
        fd =, flag)
        return os.fdopen(fd, mode, bufsize)

I don't know what _open or fsopen are.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list