From 5af5c086b563fdfa47a6891f9f18cf4e752e0908 Mon Sep 17 00:00:00 2001 From: Albert Graef <aggraef@gmail.com> Date: Fri, 20 Jan 2017 18:35:28 +0100 Subject: [PATCH] Windows compatibility. --- pd/src/s_file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pd/src/s_file.c b/pd/src/s_file.c index 32f54c312..8bf515e74 100644 --- a/pd/src/s_file.c +++ b/pd/src/s_file.c @@ -646,8 +646,10 @@ char *sys_recent_files[MAX_RECENT_FILES]; static int fexists(const char *s) { - struct stat statbuf; - return stat(s, &statbuf) == 0; + FILE *fp = sys_fopen(s, "r"); + if (!fp) return 0; + sys_fclose(fp); + return 1; } void sys_add_recent_file(const char *s) -- GitLab