stat /dev/random
, that should get you the major and minor numbers. Then use those, the syntax is literally mentioned in the manual page.# stat /dev/random
1895890688 7 crw-r--r-- 1 root wheel 7 0 "Nov 1 02:33:00 2017" "Nov 1 01:45:21 2017" "Nov 1 01:45:21 2017" "Jan 1 00:59:59 1970" 4096 0 0 /dev/random
# mknod aaaaa c 0 7
crw-r--r-- 1 root wheel 0x7 Nov 1 02:40 aaaaa
# chmod 777 aaaaa
# ls -l
crwxrwxrwx 1 root wheel 0x7 Nov 1 02:40 aaaaa
# stat aaaaa
87 31883636 crwxrwxrwx 1 root wheel 7 0 "Nov 1 02:40:58 2017" "Nov 1 02:40:58 2017" "Nov 1 02:41:06 2017" "Nov 1 02:40:58 2017" 32768 0 0 aaaaa
# dd if=aaaaa of=bbbbb
dd: aaaaa: Operation not supported
You could use a pipe for this, see mkfifo(1). The pipe is fed by a script that reads from /dev/random or /dev/zero. But I'm not sure how the web server will deal with this. It's possible the web server will try to read the file before sending it to the client. In that case the web server would never be able to finish reading the file until it dies because it ran out of memory.I wanted to put in apache http server an endless file like /dev/random or /dev/zero, so that if I go to the client and do wget http://xxxxxx/myfile it will download endless