Closed The0Dev closed 3 months ago
Interesting. Didn't know _wopen
creates a file as read-only by default.
We'll need to add _S_IREAD | _S_IWRITE
(or _S_IWRITE
alone suffices on Windows) to every _wopen
call where file is open for write.
PR is much appreciated!
Describe the issue
The function_wopen might fail to open an existing file created by the previous call to _wopen since the file is created as read-only by default. Passing _S_IREAD | _S_IWRITE as the third argument solves the issue.
To Reproduce Call WriteGltfSceneToFile (WriteBinaryGltfFile) twice.
Expected behaviour
Files should be created with the read and write permissions.
Additional context
A related question on Stackoverflow Microsoft Learn