Fixes issue where importing zipped games from Safari failed

Failed because app attempted to extract the game into the containing folder, which in this case was read-only. Fixed by extracting to temporary directory instead.
This commit is contained in:
Riley Testut 2016-12-26 15:52:58 -06:00
parent 943db4448c
commit 9648aec3b5

View File

@ -260,7 +260,8 @@ extension DatabaseManager
// ROMs may potentially be very large, so we extract using file streams and not raw Data
let inputStream = try entry.newStream()
let outputURL = url.deletingLastPathComponent().appendingPathComponent(entry.fileName)
// Must use temporary directory, and not the directory containing zip file, since the latter might be read-only (such as when importing from Safari)
let outputURL = FileManager.default.temporaryDirectory.appendingPathComponent(entry.fileName)
if FileManager.default.fileExists(atPath: outputURL.path)
{