[Pythonmac-SIG] os.pipe()

Jack Jansen jack@oratrix.nl
Thu, 19 Jul 2001 12:06:43 +0200


> I was wondering what the os.pipe() code look like. I downloaded the
> python2.1 source code again and could not find that function in the os.py
> file. Any idea where it hides?

The os module (:Lib:os.py) is a bit magic, in that it imports everything from 
an underlying module that is suystem dependent. If you look at it you'll see 
at some point
elif 'mac' in _names:
    ...
    from mac import *

and there's similar code for other platforms. Or in other words: most of the 
functionality for the os modules comes from the builtin module "mac", which 
lives (in a source distribution) in :Mac:Modules:macmodule.c. On Unix it'll 
come from the "posix" module, which lives in Modules/posixmodule.c, etc.

Inspecting macmodule.c you'll see that there's no pipe() function. Inspecting 
posixmodule.c you'll see that the pipe() function does little more than 
calling the operating system pipe() call.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm