4 ms·
If you're sending a message to some process for it to consume, like X11 or like standard input to your shell, sure, you could technically interoperate via disk,
by geofft 7y ago
If you're sending a message to some process for it to consume, like X11 or like standard input to your shell, sure, you could technically interoperate via disk, but
- UNIX itself has no inotify/kqueue/etc. feature, blocking reads are via pipes or sockets, not regular files (plain UNIX tail -f polls the file every fraction of a second)
- you're appending to the end of the file for a message that's going to get read once, and the file model of UNIX doesn't let you truncate a file from the beginning, so it will just grow indefinitely for no reason
- one benefit of the open socket/pipe approach is you get notified if the other side exits/crashes, you can't detect that from a disk file