Skip to content

Instantly share code, notes, and snippets.

@russmack
russmack / install-arch-linux-lvm-luks-dell-xps-13.md
Created November 24, 2020 14:50 — forked from chrisleekr/install-arch-linux-lvm-luks-dell-xps-15-7590.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS) for Dell XPS 13/15
@russmack
russmack / read_write_fifo_erlang.md
Created July 31, 2018 23:51 — forked from jaredmorrow/read_write_fifo_erlang.md
Reading and Writing to Fifo (named pipes) in Erlang

Erlang and Named Pipes

The intention of this post is to provide a solution (with examples) to a somewhat uncommon issue in Erlang. I hate searching for answers to the same problems over and over, and I had a hard time finding answers to this particular problem, so I wrote it all down once I figured it out. If one day you decide to read and write data through fifo's (named pipes) and then decide you want to read or write the other end of the pipe from Erlang, this post is for you.

The Problem

I wanted to read and write to a fifo from a C/C++ app and have an Erlang app communicate over the other end of that fifo. Put simply, Erlang doesn't really support what I was trying to do. You cannot just file:open/2 a fifo, or any special device for that matter, in Erlang and expect it to work. This is documented in Erlang's FAQ.

The Solution! ... ???