diff --git a/src/BRepTools/BRepTools.cxx b/src/BRepTools/BRepTools.cxx index 37b11db375..de3716bd97 100644 --- a/src/BRepTools/BRepTools.cxx +++ b/src/BRepTools/BRepTools.cxx @@ -695,7 +695,7 @@ Standard_Boolean BRepTools::Write (const TopoDS_Shape& theShape, const Message_ProgressRange& theProgress) { const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr aStream = aFileSystem->OpenOStream (theFile, std::ios::out); + std::shared_ptr aStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary); if (aStream.get() == NULL || !aStream->good()) { return Standard_False; diff --git a/src/Draw/Draw_VariableCommands.cxx b/src/Draw/Draw_VariableCommands.cxx index 8f0b4f68ec..473b212887 100644 --- a/src/Draw/Draw_VariableCommands.cxx +++ b/src/Draw/Draw_VariableCommands.cxx @@ -92,7 +92,7 @@ static Standard_Integer save (Draw_Interpretor& theDI, const char* aName = theArgVec[2]; const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr aStream = aFileSystem->OpenOStream (aName, std::ios::out); + std::shared_ptr aStream = aFileSystem->OpenOStream (aName, std::ios::out | std::ios::binary); aStream->precision (15); if (aStream.get() == NULL || !aStream->good()) { diff --git a/src/IGESControl/IGESControl_Writer.cxx b/src/IGESControl/IGESControl_Writer.cxx index 735f49ac06..c59f645a27 100644 --- a/src/IGESControl/IGESControl_Writer.cxx +++ b/src/IGESControl/IGESControl_Writer.cxx @@ -254,7 +254,7 @@ Standard_Boolean IGESControl_Writer::Write (const Standard_CString file, const Standard_Boolean fnes) { const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr aStream = aFileSystem->OpenOStream (file, std::ios::out); + std::shared_ptr aStream = aFileSystem->OpenOStream (file, std::ios::out | std::ios::binary); if (aStream.get() == NULL) { return Standard_False; diff --git a/src/IGESSelect/IGESSelect_WorkLibrary.cxx b/src/IGESSelect/IGESSelect_WorkLibrary.cxx index 50f583078c..9bfbbd2107 100644 --- a/src/IGESSelect/IGESSelect_WorkLibrary.cxx +++ b/src/IGESSelect/IGESSelect_WorkLibrary.cxx @@ -102,7 +102,7 @@ static Handle(IGESData_FileProtocol) IGESProto; if (igesmod.IsNull() || prot.IsNull()) return Standard_False; const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out); + std::shared_ptr aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::binary); if (aStream.get() == NULL) { ctx.CCheck(0)->AddFail("IGES File could not be created"); diff --git a/src/StepSelect/StepSelect_WorkLibrary.cxx b/src/StepSelect/StepSelect_WorkLibrary.cxx index 6f672e13e3..66e8ee006c 100644 --- a/src/StepSelect/StepSelect_WorkLibrary.cxx +++ b/src/StepSelect/StepSelect_WorkLibrary.cxx @@ -99,7 +99,7 @@ Standard_Boolean StepSelect_WorkLibrary::WriteFile if (stepmodel.IsNull() || stepro.IsNull()) return Standard_False; const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::trunc); + std::shared_ptr aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::binary | std::ios::trunc); if (aStream.get() == NULL) { ctx.CCheck(0)->AddFail("Step File could not be created"); diff --git a/src/VrmlAPI/VrmlAPI_Writer.cxx b/src/VrmlAPI/VrmlAPI_Writer.cxx index 0275a949de..f4a4f49a80 100644 --- a/src/VrmlAPI/VrmlAPI_Writer.cxx +++ b/src/VrmlAPI/VrmlAPI_Writer.cxx @@ -226,7 +226,7 @@ Standard_Boolean VrmlAPI_Writer::write_v1(const TopoDS_Shape& aShape,const Stand OSD_Path thePath(aFile); TCollection_AsciiString theFile;thePath.SystemName(theFile); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr anOutFile = aFileSystem->OpenOStream (theFile, std::ios::out); + std::shared_ptr anOutFile = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary); if (anOutFile.get() == NULL) { return Standard_False; @@ -370,7 +370,7 @@ Standard_Boolean VrmlAPI_Writer::write_v2(const TopoDS_Shape& aShape,const Stand aConv.Convert(anExtFace, anExtEdge); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr anOutStream = aFileSystem->OpenOStream (aFile, std::ios::out); + std::shared_ptr anOutStream = aFileSystem->OpenOStream (aFile, std::ios::out | std::ios::binary); if (anOutStream.get() != NULL) { *anOutStream << aScene; @@ -395,7 +395,7 @@ Standard_Boolean VrmlAPI_Writer::WriteDoc( aConv.ConvertDocument(theDoc); const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr anOutStream = aFileSystem->OpenOStream (theFile, std::ios::out); + std::shared_ptr anOutStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary); if (anOutStream.get() != NULL) { *anOutStream << aScene; diff --git a/src/XSDRAWIGES/XSDRAWIGES.cxx b/src/XSDRAWIGES/XSDRAWIGES.cxx index b0117bf3cb..571a2d74d2 100644 --- a/src/XSDRAWIGES/XSDRAWIGES.cxx +++ b/src/XSDRAWIGES/XSDRAWIGES.cxx @@ -76,7 +76,7 @@ void WriteShape(const TopoDS_Shape& shape, const Standard_Integer number) { char fname[110]; sprintf(fname, "Shape_%d",number); - std::ofstream f(fname,std::ios::out); + std::ofstream f(fname,std::ios::out | std::ios::binary); std::cout << "Output file name : " << fname << std::endl; f << "DBRep_DrawableShape\n"; diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx index 271d4dcdd7..bd6a537ac7 100644 --- a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx +++ b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx @@ -99,7 +99,7 @@ void XmlLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& myFileName = theFileName; const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem(); - std::shared_ptr aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out); + std::shared_ptr aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out | std::ios::binary); if (aFileStream.get() != NULL && aFileStream->good()) { Write (theDocument, *aFileStream, theRange);