Check if file is a named pipe (fifo) in python?

I communicate with a named pipe, but I would like to check if it is a named pipe before opening it.

I check Google, but there is nothing, os.path.isfile() returns False , and I really need to check it.

+15
python pipe
Dec 19 2018-11-11T00:
source share
1 answer

You can try:

  import stat, os stat.S_ISFIFO(os.stat(path).st_mode) 

docs

+25
Dec 19 '11 at 8:52
source share



All Articles