reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 516f0b349453a311793b69c81aaea1ca92b977c3
parent ce9bf904c655cf37418f83fc99465d626541c803
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun, 26 Feb 2017 21:44:18 -0800

archive: create directories as necessary when extracting directly to file

(also improve error reporting)

Diffstat:
Msrc/archive.cpp | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/archive.cpp b/src/archive.cpp @@ -215,12 +215,12 @@ ArchiveReader::~ArchiveReader() int ArchiveReader::extractFile(const Path &path) { - ofstream stream(make_autostring(Path::prefixRoot(path).join()), ios_base::binary); + ofstream stream; - if(stream) + if(FS::open(stream, path)) return extractFile(path, stream); else - throw reapack_error(FS::lastError().c_str()); + throw reapack_error(format("%s: %s") % path.join() % FS::lastError()); } int ArchiveReader::extractFile(const Path &path, ostream &stream)