From fe1f34f82e583289d77764525a556b0ffcc68994 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 11 Dec 2005 15:25:02 +0000 Subject: [PATCH] Fixed wxDirExists implementation for OS/2. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index c4fe245958..84ebf76d34 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -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; -- 2.45.2