Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: The opener parameter of Python 3 open() built-in References: <504555a5$0$29978$c3e8da3$5496439d@news.astraweb.com> <87bohm8j73.fsf@benfinney.id.au> X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney Date: Tue, 04 Sep 2012 15:20:31 +1000 Message-ID: <877gsa8iu8.fsf@benfinney.id.au> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:+45mE13hdex68fraW/5GNEE4nAQ= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 21 Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 46f60f4b.news.astraweb.com X-Trace: DXC=hkgA7A@;0?>J0Z]=gbPP29L?0kYOcDh@:^gYlR9D^Ya6E3=kG9hhb72 writes: > So, having written the opener: > > > On Mon, 03 Sep 2012 15:29:05 +0200, Christian Heimes wrote: > > > import os > > > > > > def opener(file, flags): > > > return os.open(file, flags | os.O_EXCL) > > why not call that directly? > > f = opener(file, flags) Ah, because that returns the file descriptor, not the file. I see. -- \ “If nature has made any one thing less susceptible than all | `\ others of exclusive property, it is the action of the thinking | _o__) power called an idea” —Thomas Jefferson, 1813-08-13 | Ben Finney