@@ -3151,7 +3151,7 @@ bool WriteWholeFile(std::string *err, const std::string &filepath,
3151
3151
#ifdef _WIN32
3152
3152
#if defined(__GLIBCXX__) // mingw
3153
3153
int file_descriptor = _wopen (UTF8ToWchar (filepath).c_str (),
3154
- _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
3154
+ _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE );
3155
3155
__gnu_cxx::stdio_filebuf<char > wfile_buf (
3156
3156
file_descriptor, std::ios_base::out | std::ios_base::binary);
3157
3157
std::ostream f (&wfile_buf);
@@ -7127,7 +7127,7 @@ static bool SerializeGltfBufferData(const std::vector<unsigned char> &data,
7127
7127
#ifdef _WIN32
7128
7128
#if defined(__GLIBCXX__) // mingw
7129
7129
int file_descriptor = _wopen (UTF8ToWchar (binFilename).c_str (),
7130
- _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
7130
+ _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE );
7131
7131
__gnu_cxx::stdio_filebuf<char > wfile_buf (
7132
7132
file_descriptor, std::ios_base::out | std::ios_base::binary);
7133
7133
std::ostream output (&wfile_buf);
@@ -8378,7 +8378,7 @@ static bool WriteGltfFile(const std::string &output,
8378
8378
std::ofstream gltfFile (UTF8ToWchar (output).c_str ());
8379
8379
#elif defined(__GLIBCXX__)
8380
8380
int file_descriptor = _wopen (UTF8ToWchar (output).c_str (),
8381
- _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
8381
+ _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE );
8382
8382
__gnu_cxx::stdio_filebuf<char > wfile_buf (
8383
8383
file_descriptor, std::ios_base::out | std::ios_base::binary);
8384
8384
std::ostream gltfFile (&wfile_buf);
@@ -8463,7 +8463,7 @@ static bool WriteBinaryGltfFile(const std::string &output,
8463
8463
std::ofstream gltfFile (UTF8ToWchar (output).c_str (), std::ios::binary);
8464
8464
#elif defined(__GLIBCXX__)
8465
8465
int file_descriptor = _wopen (UTF8ToWchar (output).c_str (),
8466
- _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
8466
+ _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE );
8467
8467
__gnu_cxx::stdio_filebuf<char > wfile_buf (
8468
8468
file_descriptor, std::ios_base::out | std::ios_base::binary);
8469
8469
std::ostream gltfFile (&wfile_buf);
0 commit comments