FIFO in python?

David Lees DavidL at NOraqiaSPAMMY.com
Tue Dec 19 19:39:54 CET 2000


I am trying to learn how to use FIFO and am unable to open a fifo under
Linux RedHat 6.2.  I hang on the open (open(fn,'rw'), even though I have
done a successful check for file existence (os.path.exists(fn)).  The
same code works under NT.  Any thoughts on what is going on?

Thanks in advance,

david lees


here is my code:
-------------------------
import string, os, sys

def OpenFileRW(n):
    if os.path.exists(n):
        fn=open(n,'rw')
        return fn
    else:
        print 'Filename '+name+' does not exist'
        sys.exit(-1)



fifoName='junkfifo'
fifo=OpenFileRW(fifoName)
fifo.close()
print 'done'



More information about the Python-list mailing list