A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-April/078937.html below:

[Python-Dev] Warn about mktemp once again?

[Python-Dev] Warn about mktemp once again? [Python-Dev] Warn about mktemp once again?Scott Dial scott+python-dev at scottdial.com
Tue Apr 29 08:05:49 CEST 2008
Greg Ewing wrote:
> skip at pobox.com wrote:
>> I'm not disagreeing with you, but it seems odd that os.fdopen doesn't 
>> simply
>> obey the mode of the file descriptor it receives as its argument
> 
> I'm not even sure if it's possible to find out the mode
> that a file descriptor was opened with -- is it?
> 

int mode = fcntl(fd, F_GETFL);
switch(mode) {
case O_RDONLY: ...
case O_WRONLY: ...
case O_RDWR: ...
}

> Certainly there's no way to tell whether you want it
> treated as binary, so at least that much of the mode
> needs to be specified.

Agreed.

-Scott

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4