PathFileExists

Shell32.dll

Function

Checks whether a file or directory exists.

BOOL PathFileExists(LPCSTR pszPath);

Parameters

Parameter Type Description
pszPath LPCSTR A null-terminated string that specifies the path. This can be a file or a directory.

Return Value

TRUE The file or directory specified by pszPath exists.
FALSE The file or directory does not exist, or an invalid path was provided.

Remarks

PathFileExists is identical to PathIsExisting.

This function is a wrapper for the GetFileAttributes API function. It returns TRUE if the file or directory exists, and FALSE otherwise.

If pszPath is NULL or points to an invalid path, the function returns FALSE.

Requirements

Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header Pathcch.h (include Pathcch.h)
Library Pathcch.lib
DLL Pathcch.dll
Unicode and ANSI Versions This function is ANSI- and Unicode-enabled.

See Also