Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
17738001
Commit
17738001
authored
Oct 24, 2010
by
Naumann, Andreas
Browse files
boost::iostreams truncate bug
parent
b9b2cc7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/VtkWriter.cc
View file @
17738001
...
...
@@ -29,16 +29,21 @@ namespace AMDiS {
switch
(
compress
)
{
case
GZIP
:
file
.
push
(
boost
::
iostreams
::
gzip_compressor
());
file
.
push
(
boost
::
iostreams
::
file_descriptor_sink
(
name
.
append
(
".gz"
)
));
name
.
append
(
".gz"
)
;
break
;
case
BZIP2
:
file
.
push
(
boost
::
iostreams
::
bzip2_compressor
());
file
.
push
(
boost
::
iostreams
::
file_descriptor_sink
(
name
.
append
(
".bz2"
)
))
;
name
.
append
(
".bz2"
);
break
;
default:
file
.
push
(
boost
::
iostreams
::
file_descriptor_sink
(
name
));
break
;
}
}
{
//boost::iostreams seems not to truncate the file
std
::
ofstream
swapfile
(
name
.
c_str
(),
std
::
ios
::
out
|
std
::
ios
::
trunc
);
swapfile
.
close
();
}
file
.
push
(
boost
::
iostreams
::
file_descriptor_sink
(
name
,
std
::
ios
::
trunc
));
writeFileToStream
(
file
);
#else
...
...
Write
Preview
Markdown
is supported
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