[erlang-questions] file:read_file won't read from /proc

Martin DeMello <>
Fri Mar 5 10:57:41 CET 2010

On Thu, Mar 4, 2010 at 9:37 PM, Jachym Holecek <> wrote:

> The read_file/1 thing check file size and then attempts to read exactly
> that many bytes. The size of /proc/cpuinfo is zero[*], thus read_file/1
> correctly reads zero bytes and represents the result with empty binary.

Okay, that makes sense. So what would the best way to read "files" in
/proc be? Is there any standard erlang way to read a stream till you
get an EOF?


More information about the erlang-questions mailing list