+#if U_PLATFORM_IMPLEMENTS_POSIX
+ if (dir != NULL) {
+ struct stat buf;
+ if (stat(dir, &buf) != 0) {
+ dir = NULL;
+ }
+#if defined(U_TIMEZONE_FILES_DIR)
+ else if (usingUTzFilesDir) {
+ char tzfilenamebuf[kTzfilenamebufLen];
+ uprv_strcpy(tzfilenamebuf, tzdirbuf);
+ uprv_strcat(tzfilenamebuf, U_FILE_SEP_STRING);
+#if defined(U_TIMEZONE_PACKAGE)
+ uprv_strcat(tzfilenamebuf, U_TIMEZONE_PACKAGE);
+ uprv_strcat(tzfilenamebuf, ".dat");
+#else
+ uprv_strcat(tzfilenamebuf, "zoneinfo64.res");
+#endif
+ if (stat(tzfilenamebuf, &buf) != 0) {
+ dir = NULL;
+ }
+ }
+#endif /* defined(U_TIMEZONE_FILES_DIR) */
+ }
+#endif /* U_PLATFORM_IMPLEMENTS_POSIX */