Skip to content

Latest commit

 

History

History
131 lines (95 loc) · 4.52 KB

nf-fileapi-getdiskfreespacea.md

File metadata and controls

131 lines (95 loc) · 4.52 KB
UIDtitledescriptionhelpviewer_keywordsold-locationtech.rootms.assetidms.datems.keywordsreq.headerreq.include-headerreq.target-typereq.target-min-winverclntreq.target-min-winversvrreq.kmdf-verreq.umdf-verreq.ddi-compliancereq.unicode-ansireq.idlreq.max-supportreq.namespacereq.assemblyreq.type-libraryreq.libreq.dllreq.irqltargetosreq.typenamesreq.redistms.customf1_keywordsdev_langstopic_typeapi_typeapi_locationapi_name
NF:fileapi.GetDiskFreeSpaceA
GetDiskFreeSpaceA function (fileapi.h)
Retrieves information about the specified disk, including the amount of free space on the disk. (ANSI)
GetDiskFreeSpaceA
fileapi/GetDiskFreeSpaceA
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
GetDiskFreeSpaceA
fileapi/GetDiskFreeSpaceA
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-File-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-File-l1-2-0.dll
API-MS-Win-Core-File-l1-2-1.dll
API-MS-Win-Core-File-l1-2-2.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
GetDiskFreeSpace
GetDiskFreeSpaceA
GetDiskFreeSpaceW

GetDiskFreeSpaceA function

-description

Retrieves information about the specified disk, including the amount of free space on the disk.

-parameters

-param lpRootPathName [in]

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.

-param lpSectorsPerCluster [out]

A pointer to a variable that receives the number of sectors per cluster.

-param lpBytesPerSector [out]

A pointer to a variable that receives the number of bytes per sector.

-param lpNumberOfFreeClusters [out]

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.

-param lpTotalNumberOfClusters [out]

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.

-returns

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.

-remarks

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.

-see-also

Disk Management Functions

GetDiskFreeSpaceEx

GetDriveType

close