summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-01-21 14:21:31 +0000
committertruelight <truelight@openttd.org>2007-01-21 14:21:31 +0000
commit4daaa0dcfb8a18983e8a4c3ff2716d2c285f4f8b (patch)
tree61ecfe810702b45bd4d8577dfe756bd68ac134c4
parent84cd8f49df0c71924013a0a628977f98c1b7dbea (diff)
downloadopenttd-4daaa0dcfb8a18983e8a4c3ff2716d2c285f4f8b.tar.xz
(svn r8308) [WinCE] -Revert r5764: in case of WinCE, use the code for FileExists as it was in pre-r5764 for Win32 (tnx Darkvater)
-rw-r--r--src/fios.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index a833426a3..7c736331d 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -185,7 +185,17 @@ bool FiosDelete(const char *name)
bool FileExists(const char *filename)
{
+#if defined(WINCE)
+ /* There is always one platform that doesn't support basic commands... */
+ HANDLE hand;
+
+ hand = CreateFile(OTTD2FS(filename), 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (hand == INVALID_HANDLE_VALUE) return 1;
+ CloseHandle(hand);
+ return 0;
+#else
return access(filename, 0) == 0;
+#endif
}
typedef byte fios_getlist_callback_proc(int mode, const char *filename, const char *ext, char *title);