如何从Python 3.5.3中的命名管道读取?
管道的名称和位置为/tmp/shairport-sync-metadata
,任何人都可以查看,但只能由shairport-sync
用户修改。
其他网站和问题说要使用os.mkfifo("pipe-location")
,但我一直收到此错误:
>>> import os
>>> os.mkfifo("/tmp/shairport-sync-metadata")
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
os.mkfifo("/tmp/shairport-sync-metadata")
FileExistsError: [Errno 17] File exists
有没有办法解决这个问题?抱歉,这是一个不起眼的问题。