diff --git a/source/dub/packagemanager.d b/source/dub/packagemanager.d index 321a9bd..a0f9f61 100644 --- a/source/dub/packagemanager.d +++ b/source/dub/packagemanager.d @@ -405,9 +405,11 @@ } else { if( !existsDirectory(dst_path.parentPath) ) mkdirRecurse(dst_path.parentPath.toNativeString()); - auto dstFile = openFile(dst_path, FileMode.createTrunc); - scope(exit) dstFile.close(); - dstFile.put(archive.expand(a)); + { + auto dstFile = openFile(dst_path, FileMode.createTrunc); + scope(exit) dstFile.close(); + dstFile.put(archive.expand(a)); + } setAttributes(dst_path.toNativeString(), a); ++countFiles; }