Throw a FileNotFoundException if source zip file isn't found.
This commit is contained in:
@@ -99,12 +99,11 @@ namespace OpenRA.FileSystem
|
|||||||
{
|
{
|
||||||
readonly MemoryStream pkgStream;
|
readonly MemoryStream pkgStream;
|
||||||
|
|
||||||
public ReadWriteZipFile(string filename, bool truncate = false)
|
public ReadWriteZipFile(string filename, bool create = false)
|
||||||
{
|
{
|
||||||
// SharpZipLib breaks when asked to update archives loaded from outside streams or files
|
// SharpZipLib breaks when asked to update archives loaded from outside streams or files
|
||||||
// We can work around this by creating a clean in-memory-only file, cutting all outside references
|
// We can work around this by creating a clean in-memory-only file, cutting all outside references
|
||||||
pkgStream = File.Exists(filename) && !truncate ?
|
pkgStream = create ? new MemoryStream() : new MemoryStream(File.ReadAllBytes(filename));
|
||||||
new MemoryStream(File.ReadAllBytes(filename)) : new MemoryStream();
|
|
||||||
|
|
||||||
pkgStream.Position = 0;
|
pkgStream.Position = 0;
|
||||||
pkg = ZipFileHelper.Create(pkgStream);
|
pkg = ZipFileHelper.Create(pkgStream);
|
||||||
|
|||||||
Reference in New Issue
Block a user