Closed yunfan closed 4 years ago
You could use os.fdopen()
to wrap the fd in a file
object, then wrap that in a FileStream object.
Curio provides FileStream and AsyncFile classes for wrapping files. The choice depends on whether or not the underlying file natively supports non-blocking I/O.
hi i just found this powerful library.and i had noticed that there were async file read/write methods, but they were all bound to the async fileobj , so if i had a file descriptor , how could i wrap it into these async fileobj?
PS my file descriptor came from
pty.openpty()
in case you might say why not use your api to open the file and got the fileobj