UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:fileapi.GetDiskFreeSpaceA | GetDiskFreeSpaceA function (fileapi.h) | Retrieves information about the specified disk, including the amount of free space on the disk. (ANSI) |
| fs\getdiskfreespace.htm | fs | 4fe14c49-3fd6-48b7-92de-a0c867b2e042 | 12/05/2018 | GetDiskFreeSpace, GetDiskFreeSpace function [Files], GetDiskFreeSpaceA, GetDiskFreeSpaceW, _win32_getdiskfreespace, base.getdiskfreespace, fileapi/GetDiskFreeSpace, fileapi/GetDiskFreeSpaceA, fileapi/GetDiskFreeSpaceW, fs.getdiskfreespace, winbase/GetDiskFreeSpace, winbase/GetDiskFreeSpaceA, winbase/GetDiskFreeSpaceW | fileapi.h | Windows.h | Windows | Windows XP [desktop apps \| UWP apps] | Windows Server 2003 [desktop apps \| UWP apps] | GetDiskFreeSpaceW (Unicode) and GetDiskFreeSpaceA (ANSI) | Kernel32.lib | Kernel32.dll | Windows | 19H1 |
|
|
|
|
|
|
Retrieves information about the specified disk, including the amount of free space on the disk.
The root directory of the disk for which information is to be returned. If this parameter is NULL, the function uses the root of the current disk. If this parameter is a UNC name, it must include a trailing backslash (for example, "\\MyServer\MyShare\"). Furthermore, a drive specification must have a trailing backslash (for example, "C:\"). The calling application must have FILE_LIST_DIRECTORY access rights for this directory.
A pointer to a variable that receives the number of sectors per cluster.
A pointer to a variable that receives the number of bytes per sector.
A pointer to a variable that receives the total number of free clusters on the disk that are available to the user who is associated with the calling thread.
If per-user disk quotas are in use, this value may be less than the total number of free clusters on the disk.
A pointer to a variable that receives the total number of clusters on the disk that are available to the user who is associated with the calling thread.
If per-user disk quotas are in use, this value may be less than the total number of clusters on the disk.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The GetDiskFreeSpaceEx function lets you avoid some of the arithmetic that is required by the GetDiskFreeSpace function.
Symbolic link behavior—If the path points to a symbolic link, the operation is performed on the target.
Note
The fileapi.h header defines GetDiskFreeSpace as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.