Answer the question
In order to leave comments, you need to log in
How to create a spooled file type device in linux?
Good afternoon!
The situation is such that a number of programs are written that write something to a regular file. Now there is a need to transfer data in a special way - write to a 1Kb file and make a delay of 100ms. Is there a way in Linux to do this without changing the code of already working programs?
I assumed that you can create a device in linux, in which you can write something like this:
cat > /dev/mydev
или
ofstream of("/dev/mydev");
или
cat ofile > /dev/mydev
. Answer the question
In order to leave comments, you need to log in
> I assumed that you can create a device It is possible to
create that device , but for this you must write a kernel module, master the technique of kernel modules.
> And already this device on its side will buffer and write in portions of 1 KB to the desired file with the necessary delay.
Actually, the device (from the kernel) does not write anywhere else.
In principle, this can also be done ... but this is already a perversion ... in the ideology of Linux.
"Now there is a need to transfer data in a special way - write to a 1Kb file and make a delay of 100ms."
Are you sure that the need appeared precisely in the recording with a delay of 100ms?
Can you describe why such a need is needed, and there will be a much more adequate solution?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question