mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-08 22:37:28 +05:00
check extension of filename to ensure that the loading process is successful
This commit is contained in:
parent
9b0e13730f
commit
20d6a12192
@ -409,11 +409,16 @@ namespace netgen
|
|||||||
|
|
||||||
void Mesh :: Save (const string & filename) const
|
void Mesh :: Save (const string & filename) const
|
||||||
{
|
{
|
||||||
|
ostream * outfile;
|
||||||
|
if (filename.substr(filename.length()-7,7) == ".vol.gz")
|
||||||
|
outfile = new ogzstream(filename.c_str());
|
||||||
|
else if (filename.substr(filename.length()-4,4) == ".vol")
|
||||||
|
outfile = new ofstream(filename.c_str());
|
||||||
|
else
|
||||||
|
outfile = new ogzstream((filename+".vol.gz").c_str());
|
||||||
|
|
||||||
ofstream outfile(filename.c_str());
|
Save(*outfile);
|
||||||
// ogzstream outfile( (filename+".gz") .c_str());
|
delete outfile;
|
||||||
|
|
||||||
Save(outfile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user