<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2017-10-05 19:19 GMT-07:00 Yubin Ruan <span dir="ltr"><<a href="mailto:ablacktshirt@gmail.com" target="_blank">ablacktshirt@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
I am looking for the implementation of open() in the src, but so far I<br>
am not able to do this.<br>
<br></blockquote><div>In Python 3, builtins.open is the same as io.open, which is implemented in the _io_open function in Modules/_io/_iomodule.c.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>From my observation, the implementation of open() in python2/3 does<br>
not employ the open(2) system call. However without open(2) how can<br>
one possibly obtain a file descriptor?<br></blockquote><div>There is a call to open() (the C function) in _io_FileIO___init___impl in Modules/_io/fileio.c. I haven't traced through all the code, but I suspect builtins.open ends up calling that. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Yubin<br>
______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/jelle.zijlstra%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>jelle.zijlstra%40gmail.com</a><br>
</blockquote></div><br></div></div>