python - os.open(): no such device or address?
<p>I want to try my hands on named pipes so i downloaded a piece of code and modify it to test out:</p>

<pre><code>fifoname = '/home/foo/pipefifo'                       # must open same name

def child( ):
    pipeout = os.open(fifoname, os.O_NONBLOCK|os.O_WRONLY)     # open fifo pipe file as fd
    zzz = 0
    while 1:
        time.sleep(zzz)
        os.write(pipeout, 'Spam %03d\n' % zzz)
        zzz = (zzz+1) % 5

def parent( ):
    pipein = open(fifoname, 'r')                 # open fifo as stdio object
    while 1:
        line = pipein.readline( )[:-1]            # blocks until data sent
        print 'Parent %d got "%s" at %s' % (os.getpid(), line, time.time( ))

if __name__ == '__main__':
    if not os.path.exists(fifoname):
        os.mkfifo(fifoname)                       # create a named pipe file
    if len(sys.argv) == 1:
        parent( )                                 # run as parent if no args
    else:
          child() 
</code></pre>

<p>I tried running the script but it kept returning </p>

<pre><code>pipeout = os.open(fifoname, os.O_NONBLOCK|os.O_WRONLY)     # open fifo pipe file as fd
OSError: [Errno 6] No such device or address: '/home/carrier24sg/pipefifo'
</code></pre>

<p>can anyone tell me whats wrong? (am running python 2.6.5 in linux)</p>
