diff --git a/Zip/Zip.swift b/Zip/Zip.swift index a2eb11593097dc63e69929c4e1d913d8a32605b2..298f99f789a2b9eefb631039905159b1baf90e55 100644 --- a/Zip/Zip.swift +++ b/Zip/Zip.swift @@ -165,8 +165,15 @@ public class Zip { let fullPath = destination.appendingPathComponent(pathString).path let creationDate = Date() - let directoryAttributes = [FileAttributeKey.creationDate.rawValue : creationDate, - FileAttributeKey.modificationDate.rawValue : creationDate] + + #if swift(>=4.0) + let directoryAttributes = [FileAttributeKey.creationDate : creationDate, + FileAttributeKey.modificationDate : creationDate] + #else + let directoryAttributes = [FileAttributeKey.creationDate.rawValue : creationDate, + FileAttributeKey.modificationDate.rawValue : creationDate] + #endif + do { if isDirectory { try fileManager.createDirectory(atPath: fullPath, withIntermediateDirectories: true, attributes: directoryAttributes)