File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 88#include < regex>
99#include < sstream>
1010
11+ #ifdef _WIN32
12+ #include < windows.h>
13+ #else // POSIX
14+ #include < sys/stat.h>
15+ #endif
16+
1117namespace duckdb
1218{
1319 namespace netquack
1420 {
21+ bool file_exists (const char *file_path)
22+ {
23+ #ifdef _WIN32
24+ DWORD attributes = GetFileAttributesA (file_path);
25+ return (attributes != INVALID_FILE_ATTRIBUTES);
26+ #else // POSIX
27+ struct stat buffer;
28+ return (stat (file_path, &buffer) == 0 );
29+ #endif
30+ }
31+
1532 CURL *GetCurlHandler ()
1633 {
1734 CURL *curl = curl_easy_init ();
@@ -34,9 +51,8 @@ namespace duckdb
3451 " /etc/ssl/cert.pem" // Alpine Linux
3552 })
3653 {
37- if (FILE *f = fopen (path, " r " ))
54+ if (file_exists (path))
3855 {
39- fclose (f);
4056 ca_info = path;
4157 break ;
4258 }
You can’t perform that action at this time.
0 commit comments