# GetDiskSpace

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

## Purpose

This function determines the free space in a specified directory on disk. On the original OEM release of Windows 95, this function is not guaranteed to be reliable when handling partitions over 2G.

## Parameters

Input
Name | Type | Description
directory | const char [] | The directory for which to obtain size information. This parameter can be a root drive, or any subdirectory off of that drive. This function will obtain the space available within this directory (including subdirectories).
Output
Name | Type | Description
totalBytes | UInt64Type * | Returns the total number of bytes in the specified directory. 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 to the calling process in the specified directory. 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 | integer | 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.