+/* Return true if FILENAME exists. */
+bool
+check_existing (const char *filename)
+{
+#ifdef DOS_NT
+ /* The full emulation of Posix 'stat' is too expensive on
+ DOS/Windows, when all we want to know is whether the file exists.
+ So we use 'access' instead, which is much more lightweight. */
+ return (access (filename, F_OK) >= 0);
+#else
+ struct stat st;
+ return (stat (filename, &st) >= 0);
+#endif
+}