How can i measure disk size using elixir?

i am new into elixir and phoenix. I have found in erlang, to check disk space using --diskup. And i have found another function/statement inside elixir to check total memory usage:

> :erlang.memory(:total)

My question is how can check disk size/space of my current system ?

Upvotes: 3

Views: 597

Answers (2)

Roman Rabinovich
Roman Rabinovich

Reputation: 918

Or you could just do os:cmd("df") in erlang.

Upvotes: 0

bxdoan
bxdoan

Reputation: 1369

The disksup module belongs to the os_mon application which in turn is dependent on the sasl application. Therefore you need to start these applications before you call.

> :application.start(:sasl)
> :application.start(:os_mon)
> :disksup.get_disk_data()

Now you can use all functions similar with Erlang.

Upvotes: 8

Related Questions