Admin Production ni-theme
Current Publication

GetDiskSpace

LabWindows/CVI

GetDiskSpace

int GetDiskSpace (const char directory[], UInt64Type *totalBytes, UInt64Type *totalBytesFree);

Purpose

This function retrieves the amount of space available on a disk volume, which consists of the total amount of used space and the total amount of free space.

(Linux) This function is not supported.

Parameters

Input
Name Type Description
directory const char[] The disk volume for which to obtain size information. If you pass a path to a subdirectory, for example C:\temp, the function retrieves information for the volume C:\.
Output
Name Type Description
totalBytes UInt64Type Returns the total capactiy for the volume, in bytes.

This 64–bit unsigned integer value is returned in the following structure:

typedef struct {
    unsigned long int loBytes;
    unsigned long int hiBytes;
} UInt64Type;


The loBytes member will contain the low–order 32–bits of the value, and the hiBytes member will contain the high–order 32–bits of the value. Use the function UInt64TypeCompareUInt to compare this value with a native 32–bit unsigned long integer.
totalBytesFree UInt64Type Returns the number of bytes free in the specified volume.

This 64–bit unsigned integer value is returned in the following structure:

typedef struct {
    unsigned long int loBytes;
    unsigned long int hiBytes;
} UInt64Type;


The loBytes member will contain the low–order 32–bits of the value, and the hiBytes member will contain the high–order 32–bits of the value. Use the function UInt64TypeCompareUInt to compare this value with a native 32–bit unsigned long integer.

Return Value

Name Type Description
status int The status code that the function returns.

0 indicates success.

A negative value indicates an error.

This function may return a Programmer's Toolbox or UI Library error code. Call GetGeneralErrorString to obtain a text description of the error.

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later