mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +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
|
||||
{
|
||||
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());
|
||||
// ogzstream outfile( (filename+".gz") .c_str());
|
||||
|
||||
Save(outfile);
|
||||
Save(*outfile);
|
||||
delete outfile;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user