<?php
$file = '/tmp/tmpfile'; // file name
$type = POSIX_S_IFBLK; // file type
$permissions = 0777; // octal
$major = 1;
$minor = 8; // /dev/random
if (!posix_mknod($file, $type | $permissions, $major, $minor)) {
die('Error ' . posix_get_last_error() . ': ' . posix_strerror(posix_get_last_error()));
}
?>