Ref: https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen
Ref: #19645
Cherry-picked from #19643
Closes #19647
else
mode |= O_TRUNC;
-#if (defined(ANDROID) || defined(__ANDROID__)) && \
+#ifdef _WIN32
+ fd = curlx_open(file->path, mode,
+ data->set.new_file_perms & (_S_IREAD | _S_IWRITE));
+#elif (defined(ANDROID) || defined(__ANDROID__)) && \
(defined(__i386__) || defined(__arm__))
fd = curlx_open(file->path, mode, (mode_t)data->set.new_file_perms);
#else