EgtGeneral 1.6e1 :

- aggiunta ExistsDirectory.
This commit is contained in:
Dario Sassi
2015-05-04 07:30:33 +00:00
parent fcde284912
commit f48f1556b4
2 changed files with 13 additions and 0 deletions
+13
View File
@@ -89,6 +89,19 @@ FindFirstFileEgt( const string& sFileSpec, string& sFileName)
return false ;
}
//----------------------------------------------------------------------------
bool
ExistsDirectory( const string& sDir)
{
// leggo gli attributi del direttorio
DWORD dwAttr = ::GetFileAttributesW( stringtoW( sDir)) ;
// se non esiste
if ( dwAttr == INVALID_FILE_ATTRIBUTES)
return false ;
// se è un direttorio
return ( (dwAttr & FILE_ATTRIBUTE_DIRECTORY) != 0) ;
}
//-----------------------------------------------------------------------------
bool
EmptyDirectory( const string& sDir)