How to check wheter a specified path is a dir?
-
See title:), thanks.. Couldn't find the functions using MSDN or google:(..
-
See title:), thanks.. Couldn't find the functions using MSDN or google:(..
GetFileAttributes(), check the FILE_ATTRIBUTE_DIRECTORY bit.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
Honoured as one of The Most Helpful Members of 2004
-
See title:), thanks.. Couldn't find the functions using MSDN or google:(..
//! Checks whether a directory exists.
//! @param strDirectory Directory
//! @return true if the directory exists, false otherwise.
bool dirExists
(CString strDirectory)
{
// Create full directory specification - return if unable
TCHAR* fullPath = _tfullpath (NULL, strDirectory, 0);
if (fullPath == NULL)
return (false);// Check if directory exists by trying to make it the default directory
TCHAR szCurrDir [_MAX_PATH];
_tgetcwd (szCurrDir, _MAX_PATH - 1);
long nStatus = _tchdir (fullPath);
_tchdir (szCurrDir);// Return
free (fullPath);
if (nStatus == 0)
return (true);
return (false);
}/ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com
-
See title:), thanks.. Couldn't find the functions using MSDN or google:(..
Or
PathIsDirectory()
in shlwapi.dll --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD