Disk space used and free size of a Network share folder in Windows

FreeSlave freeslave93 at gmail.com
Wed Feb 14 22:22:35 UTC 2018


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"]);
> writeln(result.output);
> }
> }
> Output :
> Caption  FreeSpace    Size
> C:       19702837248  180043665408
> H:       85580382208  824633720832
>
> From,
> Vino.B

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


More information about the Digitalmars-d-learn mailing list