Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
5eaf0277
Commit
5eaf0277
authored
Dec 05, 2016
by
Kilian Lackhove
Browse files
use a dot to separate bak0 extension so that paraview & co still recognize file groups
parent
1c946011
Changes
1
Show whitespace changes
Inline
Side-by-side
library/LibUtilities/BasicUtils/FieldIO.cpp
View file @
5eaf0277
...
@@ -411,15 +411,15 @@ std::string FieldIO::SetUpOutput(const std::string outname, bool perRank, bool b
...
@@ -411,15 +411,15 @@ std::string FieldIO::SetUpOutput(const std::string outname, bool perRank, bool b
// in case we are rank 0 or not on a shared filesystem, check if the specPath already exists
// in case we are rank 0 or not on a shared filesystem, check if the specPath already exists
if
(
backup
&&
(
rank
==
0
||
!
m_sharedFilesystem
)
&&
fs
::
exists
(
specPath
))
if
(
backup
&&
(
rank
==
0
||
!
m_sharedFilesystem
)
&&
fs
::
exists
(
specPath
))
{
{
// rename. foo/bar_123.chk -> foo/bar_123
_
bak0.chk and in case
// rename. foo/bar_123.chk -> foo/bar_123
.
bak0.chk and in case
// foo/bar_123
_
bak0.chk already exists, foo/bar_123.chk -> foo/bar_123
_
bak1.chk
// foo/bar_123
.
bak0.chk already exists, foo/bar_123.chk -> foo/bar_123
.
bak1.chk
fs
::
path
bakPath
=
specPath
;
fs
::
path
bakPath
=
specPath
;
int
cnt
=
0
;
int
cnt
=
0
;
while
(
fs
::
exists
(
bakPath
))
while
(
fs
::
exists
(
bakPath
))
{
{
bakPath
=
specPath
.
parent_path
();
bakPath
=
specPath
.
parent_path
();
bakPath
+=
specPath
.
stem
();
bakPath
+=
specPath
.
stem
();
bakPath
+=
fs
::
path
(
"
_
bak"
+
boost
::
lexical_cast
<
std
::
string
>
(
cnt
++
));
bakPath
+=
fs
::
path
(
"
.
bak"
+
boost
::
lexical_cast
<
std
::
string
>
(
cnt
++
));
bakPath
+=
specPath
.
extension
();
bakPath
+=
specPath
.
extension
();
}
}
std
::
cout
<<
"renaming "
<<
specPath
<<
" -> "
<<
bakPath
<<
std
::
endl
;
std
::
cout
<<
"renaming "
<<
specPath
<<
" -> "
<<
bakPath
<<
std
::
endl
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment