mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
Tidied up some comments and usage of File::createOutputStream() and createInputStream()
This commit is contained in:
parent
81e206f963
commit
302019dd43
13 changed files with 114 additions and 87 deletions
|
|
@ -279,13 +279,15 @@ namespace
|
|||
std::cout << "Writing: " << targetFile.getFullPathName() << std::endl;
|
||||
|
||||
TemporaryFile temp (targetFile);
|
||||
std::unique_ptr<FileOutputStream> out (temp.getFile().createOutputStream());
|
||||
|
||||
bool ok = out != nullptr && zip.writeToStream (*out, nullptr);
|
||||
out.reset();
|
||||
ok = ok && temp.overwriteTargetFileWithTemporary();
|
||||
{
|
||||
FileOutputStream out (temp.getFile());
|
||||
|
||||
if (! ok)
|
||||
if (! (out.openedOk() && zip.writeToStream (out, nullptr)))
|
||||
ConsoleApplication::fail ("Failed to write to the target file: " + targetFile.getFullPathName());
|
||||
}
|
||||
|
||||
if (! temp.overwriteTargetFileWithTemporary())
|
||||
ConsoleApplication::fail ("Failed to write to the target file: " + targetFile.getFullPathName());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue