Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
File.mkfifo
(::string | ::_ToPath file_name, ?::int mode) -> 0
File.mkfifo(file_name, mode=0666) => 0
file.c
View on GitHub ↗
static VALUE
rb_file_s_mkfifo(int argc, VALUE *argv, VALUE _)
{
VALUE path;
struct mkfifo_arg ma;
ma.mode = 0666;
rb_check_arity(argc, 1, 2);
if (argc > 1) {
ma.mode = NUM2MODET(argv[1]);
}
path = argv[0];
FilePathValue(path);
path = rb_str_encode_ospath(path);
ma.path = RSTRING_PTR(path);
if (IO_WITHOUT_GVL(nogvl_mkfifo, &ma)) {
rb_sys_fail_path(path);
}
return INT2FIX(0);
}
Creates a FIFO special file with name file_name. mode specifies the FIFO’s permissions. It is modified by the process’s umask in the usual way: the permissions of the created file are (mode & ~umask).