mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 18:30:35 +05:00
Additional fix for bug PAL13701(EDF 319 SMESH : Export UNV failed with not enough space disk --> No user information).
This commit is contained in:
parent
2322b79c1a
commit
a3c6d051d0
@ -35,6 +35,7 @@
|
|||||||
#include "UNV_Utilities.hxx"
|
#include "UNV_Utilities.hxx"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace UNV;
|
||||||
|
|
||||||
namespace{
|
namespace{
|
||||||
typedef std::vector<size_t> TConnect;
|
typedef std::vector<size_t> TConnect;
|
||||||
@ -292,6 +293,11 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
|
|||||||
}
|
}
|
||||||
UNV2417::Write(out_stream,aDataSet2417);
|
UNV2417::Write(out_stream,aDataSet2417);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
out_stream.flush();
|
||||||
|
out_stream.close();
|
||||||
|
if (!check_file(myFile))
|
||||||
|
EXCEPTION(runtime_error,"ERROR: Output file not good.");
|
||||||
}
|
}
|
||||||
catch(const std::exception& exc){
|
catch(const std::exception& exc){
|
||||||
INFOS("Follow exception was cought:\n\t"<<exc.what());
|
INFOS("Follow exception was cought:\n\t"<<exc.what());
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -88,6 +89,24 @@ namespace UNV{
|
|||||||
return atof (number.c_str());
|
return atof (number.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns \p false when file is incorrect, \p true otherwise.
|
||||||
|
* Check file with name \p theFileName for correct terminate
|
||||||
|
* string, i.e. the next to the last line is equal to " -1",
|
||||||
|
*/
|
||||||
|
inline bool check_file(const std::string theFileName)
|
||||||
|
{
|
||||||
|
std::ifstream in_stream(theFileName.c_str());
|
||||||
|
if (!in_stream)
|
||||||
|
return false;
|
||||||
|
std::string olds, news;
|
||||||
|
while (!in_stream.eof()){
|
||||||
|
olds = news;
|
||||||
|
std::getline(in_stream, news, '\n');
|
||||||
|
}
|
||||||
|
return (olds == " -1");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user