mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0030403: Application Framework - Overwriting Big BinOcaf Files Does Not Reduce Their Size
OSD_OpenFileDescriptor(), added truncating flag to fopen() flags for std::ios_base::out, since truncating is implied by C++ output flag. This fixes misbehavior of OSD_OpenStream() on MinGW-w64 platform.
This commit is contained in:
parent
bc28da5c3a
commit
718d07fe5e
@ -34,14 +34,12 @@ static int OSD_OpenFile_iosMode2FileFlags (::std::ios_base::openmode theMode)
|
|||||||
{
|
{
|
||||||
aFlags |= O_WRONLY;
|
aFlags |= O_WRONLY;
|
||||||
aFlags |= O_CREAT;
|
aFlags |= O_CREAT;
|
||||||
|
aFlags |= O_TRUNC;
|
||||||
|
|
||||||
if (theMode & ::std::ios_base::app)
|
if (theMode & ::std::ios_base::app)
|
||||||
{
|
{
|
||||||
aFlags |= O_APPEND;
|
aFlags |= O_APPEND;
|
||||||
}
|
}
|
||||||
if (theMode & ::std::ios_base::trunc)
|
|
||||||
{
|
|
||||||
aFlags |= O_TRUNC;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (theMode & ::std::ios_base::binary)
|
if (theMode & ::std::ios_base::binary)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user