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:
parent
943db4448c
commit
9648aec3b5
@ -260,7 +260,8 @@ extension DatabaseManager
|
|||||||
// ROMs may potentially be very large, so we extract using file streams and not raw Data
|
// ROMs may potentially be very large, so we extract using file streams and not raw Data
|
||||||
let inputStream = try entry.newStream()
|
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)
|
if FileManager.default.fileExists(atPath: outputURL.path)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user