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 8
8
#include < regex>
9
9
#include < sstream>
10
10
11
+ #ifdef _WIN32
12
+ #include < windows.h>
13
+ #else // POSIX
14
+ #include < sys/stat.h>
15
+ #endif
16
+
11
17
namespace duckdb
12
18
{
13
19
namespace netquack
14
20
{
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
+
15
32
CURL *GetCurlHandler ()
16
33
{
17
34
CURL *curl = curl_easy_init ();
@@ -34,9 +51,8 @@ namespace duckdb
34
51
" /etc/ssl/cert.pem" // Alpine Linux
35
52
})
36
53
{
37
- if (FILE *f = fopen (path, " r " ))
54
+ if (file_exists (path))
38
55
{
39
- fclose (f);
40
56
ca_info = path;
41
57
break ;
42
58
}
You can’t perform that action at this time.
0 commit comments