]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
added arrow cursor for standard controls
[wxWidgets.git] / src / common / filefn.cpp
index 7a30b5eb6f4662755cc33b9e984617881bdfd643..935fa8608c46ee58b703f0cbade8384e82cd495e 100644 (file)
@@ -75,7 +75,7 @@
     #include <process.h>
     #include "wx/os2/private.h"
 #endif
-#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
+#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) && !defined(__WXWINE__)
 #if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__SALFORDC__)
     #include <direct.h>
     #include <dos.h>
@@ -326,18 +326,16 @@ wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
 bool
 wxFileExists (const wxString& filename)
 {
+    // we must use GetFileAttributes() instead of the ANSI C functions because
+    // it can cope with network (UNC) paths unlike them
 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
-    // GetFileAttributes can copy with network paths unlike stat()
     DWORD ret = ::GetFileAttributes(filename);
 
     return (ret != (DWORD)-1) && !(ret & FILE_ATTRIBUTE_DIRECTORY);
-#else
-    wxStructStat stbuf;
-    if ( !filename.empty() && wxStat( filename, &stbuf) == 0 )
-        return TRUE;
-
-    return FALSE;
-#endif
+#else // !__WIN32__
+    wxStructStat st;
+    return wxStat(filename, &st) == 0 && (st.st_mode & S_IFREG);
+#endif // __WIN32__/!__WIN32__
 }
 
 bool