Ross Lagerwall <rosslagerw...@gmail.com> added the comment:

Before I implement it properly, is this the kind of api that's desired?

"""
import os
import io

class MyOpener:
    def __init__(self, dirname):
        self.dirfd = os.open(dirname, os.O_RDONLY)

    def open(self, path, flags, mode):
        return os.openat(self.dirfd, path, flags, mode)

myop = MyOpener("/tmp")
f = open("testfile", "w", opener=myop.open)
f.write("hello")
"""

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12797>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to