Unix FIFO在哪里? [英] Unix FIFO in go?

查看:84
本文介绍了Unix FIFO在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Go语言创建unix FIFO?尽管我希望在posix OS中大量使用命名FIFO,但是在os包中没有Mkfifo,也没有Mknod.实际上,这里有创建未命名FIFO(管道)的功能,但是没有创建命名管道的功能.

Is there any way to create a unix FIFO with Go language? There is no Mkfifo, nor Mknod in os package, though I expected named FIFOs are largely used in posix OS's. In fact, there is a function for creating an unnamed FIFO (pipe), but no function for creating named pipes.

我是唯一需要他们的人吗?

Am I the only one who needs them?

推荐答案

为了使其能够在Linux上运行,我只是做了

In order to get it to work on Linux, I simply did a

syscall.Mknod(fullPath, syscall.S_IFIFO|0666, 0)

这似乎可以解决问题.

此处是对基础mknod()调用的引用

Here is a reference for the underlying mknod() call

这篇关于Unix FIFO在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆