diskfree

by

 

29 Jan 2007 (Updated )

Queries the free space of a volume

diskfree(volume)
function [free total avail] = diskfree(volume)
% [free total avail] = diskfree(volume)
%
% diskfree    Queries the free space of a volume
%
% Input:
%   volume,   volume pathname - the drive letter followed by a colon
%
% Outputs:
%   free,       total of free bytes
%   total,      total of bytes     
%   avail,      total of avail free bytes
%
% Example:
%   [free total avail] = diskfree('C:')
%
% Martin Furlan
% martin.furlan@iskra-ae.com
% January 2007

[status,result] = system(['fsutil volume diskfree ',volume]);
[result] = regexp(result,'\d+','match');

free  = str2num(result{1});
total = str2num(result{2}); 
avail = str2num(result{3}); 

Contact us