Message56613
| Author |
gvanrossum |
| Recipients |
brett.cannon, christian.heimes, gvanrossum |
| Date |
2007年10月20日.22:36:15 |
| SpamBayes Score |
0.0017667125 |
| Marked as misclassified |
No |
| Message-id |
<ca471dc20710201536x53a22f1di337c0b04732e8e04@mail.gmail.com> |
| In-reply-to |
<471A6241.5090907@cheimes.de> |
| Content |
> Is PyFile_FromFd and PyFile_FromFdEx fine with you or do you prefer a
> different name like PyFile_FromFD and PyFile_FromFDEx or
> PyFile_FromFileDescriptor?
Let's have a single function PyFile_FromFd(fd, name, mode, buffering,
encoding, newline).
> I've another question. The os.tmpfile method is using tmpfile() which
> returns a file pointer. Do I have to dup its file number and explictely
> close the file pointer as shown below or is a simple fileno() enough?
You should dup it; if you don't dup it, the fd will be closed when you
call fclose(), rendering it useless; or when you don't call fclose(),
you leak a FILE struct each time. |
|