On Wednesday, 14 February 2018 at 15:24:42 UTC, Vino wrote:
On Wednesday, 14 February 2018 at 12:29:13 UTC, rikki cattermole wrote:

Hi Rikki,

Wouldn't this be easy to use with std.process: execute package and calling wmic.exe, the only problem is i am not sure hot to get the out put without the headings(Caption FreeSpace,Size) any help on same is much appreciated.

import std.process: execute;
import std.stdio : writeln;

void main () {
version(Windows) {
auto result = execute(["wmic.exe", "logicaldisk", "get", "size,freespace,caption"]);
Output :
Caption  FreeSpace    Size
C:       19702837248  180043665408
H:       85580382208  824633720832


Don't call external processes when you can call a function. Running another process is overhead and not reliable.

Reply via email to