Fixed wxDirExists implementation for OS/2.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2005-12-11 15:25:02 +00:00
parent 65785aa966
commit fe1f34f82e

View File

@@ -1237,7 +1237,13 @@ bool wxDirExists(const wxChar *pszPathName)
return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY);
#elif defined(__OS2__)
return (bool)(::DosSetCurrentDir((PSZ)(WXSTRINGCAST strPath)));
FILESTATUS3 Info = {{0}};
APIRET rc = ::DosQueryPathInfo((PSZ)(WXSTRINGCAST strPath), FIL_STANDARD,
(void*) &Info, sizeof(FILESTATUS3));
return ((rc == NO_ERROR) && (Info.attrFile & FILE_DIRECTORY)) ||
(rc == ERROR_SHARING_VIOLATION);
// If we got a sharing violation, there must be something with this name.
#else // !__WIN32__
wxStructStat st;