mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-14 07:04:51 -04:00
Check for cache directory just-in-time
This commit is contained in:
parent
ca1af45d7d
commit
08cf22f07d
1 changed files with 6 additions and 0 deletions
|
@ -124,6 +124,12 @@ struct ListRow: View {
|
||||||
if cacheDownloads {
|
if cacheDownloads {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
var isDirectory: ObjCBool = false
|
||||||
|
|
||||||
|
if !FileManager.default.fileExists(atPath: cacheDirectory, isDirectory: &isDirectory) {
|
||||||
|
try FileManager.default.createDirectory(atPath: cacheDirectory, withIntermediateDirectories: true)
|
||||||
|
}
|
||||||
|
|
||||||
let attributes: [FileAttributeKey: Any] = try FileManager.default.attributesOfItem(atPath: cacheDirectory)
|
let attributes: [FileAttributeKey: Any] = try FileManager.default.attributesOfItem(atPath: cacheDirectory)
|
||||||
|
|
||||||
guard let posixPermissions: NSNumber = attributes[.posixPermissions] as? NSNumber else {
|
guard let posixPermissions: NSNumber = attributes[.posixPermissions] as? NSNumber else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue