Sounds Logical
Send Page To a Friend

Table Of Contents Previous Page Next Page

[M-Utilities overview]

M-Utilities: MATLAB function reference

windrivespace
Version 1.0 Requires MATLAB 6.0 (R12) or later

Determine the size and available space (in bytes) of a hard-drive (PC-Windows only).

File format: mex-file
Editable source code:
no
Utilises non-editable functions: yes (Windows API dll's)
Platform:
PC/Windows
Required MATLAB Toolboxes: none (except core MATLAB)
Demo version limitations: query C drive only
Syntax:
 

space=windrivespace(DriveLetterString);

Arguments:
Input:
DriveLetterString

string containing the drive letter (e.g. 'C' or 'D' etc)

NOTE: only the drive letter (with no other characters)
should be contained in the string

Output:
space

a 3-vector containing the following results:

space[1] -- the total size of the drive (in bytes)
space[2] -- the total free space on the drive (in bytes)
space[3] -- the free space allocated to you (in bytes)

Note: space[3] may be less than the total free space, depending on the Administrative settings on your computer.

If the query fails for whatever reason, the result [0 0 0] is returned. This can happen if, for example, the specified drive doesn't exist on a given machine.

This function is implemented as a mex function (Windows DLL) called windrivespace.dll. The accompanying windrivespace.m file simply contains the help comments for access via the usual MATLAB 'help' command.
 
Examples:
Query the C-drive:
  space=windrivespace('C');
   
Typical result:
  space =

1620379648
252262400
252262400

Top Of Page Table Of Contents Previous Page Next Page

Send Page To a Friend

home - news - products - store - support - site map - company info
© 2007 Sounds Logical. All rights reserved.
Sounds Logical
legal notice - privacy statement