pub fn mkfifo<P: AsRef<Path>>(path: P, permissions: Permissions) -> Result<()>
unix_mkfifo #139324)
Create a FIFO special file at the specified path with the specified mode.
mkfifo("/tmp/fifo", Permissions::from_mode(0o774))?;
let mut wx = File::options().read(true).write(true).open("/tmp/fifo")?;
let mut rx = File::open("/tmp/fifo")?;
wx.write_all(b"hello, world!")?;
drop(wx);
let mut s = String::new();
rx.read_to_string(&mut s)?;
assert_eq!(s, "hello, world!");
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/os/unix/fs/fn.mkfifo.html