PathIsDirectory function
Applies to: desktop apps only
Verifies that a path is a valid directory.
Syntax
BOOL PathIsDirectory( __in LPCTSTR pszPath );
Parameters
- pszPath [in]
-
Type: LPCTSTR
A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to verify.
Return value
Type: BOOL
Returns (BOOL)FILE_ATTRIBUTE_DIRECTORY if the path is a valid directory; otherwise, FALSE.
Requirements
|
Minimum supported client | Windows 2000 Professional, Windows XP |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | PathIsDirectoryW (Unicode) and PathIsDirectoryA (ANSI) |
Send comments about this topic to Microsoft
Build date: 3/7/2012
- 1/2/2012
- Scott Deaver - GE
The description of "Return Value" is wrong.
The correct wording should read:
Returns FILE_ATTRIBUTE_DIRECTORY if the path is a valid directory, or FALSE otherwise.
FALSE = 0
FILE_ATTRIBUTE_DIRECTORY = 16
- 3/2/2010
- Detlev Dalitz
It seems to be either FALSE (0) or a non-zero (0x10) value, if(PathIsDirectory() == TRUE) does not eval to true, surprisingly.
Tested it under w7 just now.
- 11/30/2009
- Gabest
Locally this is usually fast, but over the network this can be slow. Don't make this call on UI threads, instead call this function in background worker threads.
- 5/11/2009
- Chris_Guzak
- 8/8/2009
- mortaza.doulaty