I have a project where I am additionally trying to get some system info (system memory usage, load averages, etc), but since Elixir or Erlang doesn’t seem to have something to the effect of what psutil can do for Python, I figured I’d just grab info the way that the OS expects you to. For my issue here, trying to simply read /proc/loadavg
. If I simply do cat /proc/loadavg
then I get the info, likewise I can get the info with Python using psutil
. I figured I could simply do a File.read/1
but that doesn’t appear to work. This is what I get:
iex> File.read!("/proc/loadavg")
{:ok, ""}
Not sure why Elixir can’t read from procfs. Feels kind of cheesy calling cat
for this.