+ return S_ISDIR(info.st_mode);
+#endif
+}
+
+bool is_file(const char *path) {
+#ifdef _WIN32
+ struct _stat info;
+ if (_stat(path, &info) != 0) {
+ return false;
+ }
+ return (info.st_mode & _S_IFREG) != 0;
+#else
+ struct stat info;
+ if (stat(path, &info) != 0) {
+ return false;
+ }
+ return S_ISREG(info.st_mode);