简体   繁体   中英

How can we create 'special' files, like /dev/random, in linux?

In Linux file system, there are files such as /dev/zero and /dev/random which are not real files on hard disk.

Is there any way that we can create a similar file and tell it to get ouput from executing a program?

For example, can I create file, say /tmp/tarfile, such that any program reading it actually gets the output from the execution of a different program (/usr/bin/tar ...)?

可以创建这样的文件/程序,但是需要创建一个特殊的文件系统才能将钩子插入VFS,以便可以检测和正确处理访问。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM