2 ms·
one restriction on the OS side that comes from Erlang and thus by extension Elixir(from the erlang FAQ: "9.12 Why can't I open devices (e.g. a serial port) lik
by fridder 1y ago
one restriction on the OS side that comes from Erlang and thus by extension Elixir(from the erlang FAQ: "9.12 Why can't I open devices (e.g. a serial port) like normal files?
Short answer: because the erlang runtime system was not designed to do that. The Erlang runtime system's internal file access system, efile, must avoid blocking, otherwise the whole Erlang system will block. This is not a good thing in a soft real-time system. When accessing regular files, it's generally a reasonable assumption that operations will not block. Devices, on the other hand, are quite likely to block. Some devices, such as serial ports, may block indefinitely. There are several possible ways to solve this. The Erlang runtime system could be altered, or an external port program could be used to access the device. Two mailing list discussions about the topic can be found here and here."
- pjmlp 1y agoUNIX IPC is not files based, this is exactly one scenario where "everything is a file" fails, so I don't quite follow.