diff --git a/cocos/platform/CCFileStream.cpp b/cocos/platform/CCFileStream.cpp index 74ac55751c..627617cbdd 100644 --- a/cocos/platform/CCFileStream.cpp +++ b/cocos/platform/CCFileStream.cpp @@ -11,7 +11,7 @@ #if defined(_WIN32) #define O_READ_FLAGS O_BINARY | O_RDONLY, S_IREAD -#define O_WRITE_FLAGS O_CREAT | O_RDWR | O_BINARY, S_IWRITE | S_IREAD +#define O_WRITE_FLAGS O_CREAT | O_RDWR | O_BINARY | O_TRUNC, S_IWRITE | S_IREAD #define O_APPEND_FLAGS O_APPEND | O_CREAT | O_RDWR | O_BINARY, S_IWRITE | S_IREAD #define posix_open ::_open #define posix_close ::_close @@ -20,7 +20,7 @@ #define posix_write ::_write #else #define O_READ_FLAGS O_RDONLY, S_IRUSR -#define O_WRITE_FLAGS O_CREAT | O_RDWR, S_IRWXU +#define O_WRITE_FLAGS O_CREAT | O_RDWR | O_TRUNC, S_IRWXU #define O_APPEND_FLAGS O_APPEND | O_CREAT | O_RDWR, S_IRWXU #define posix_open ::open #define posix_close ::close