diff --git a/Zip/Zip.swift b/Zip/Zip.swift index a2eb11593097dc63e69929c4e1d913d8a32605b2..981f63278f1a83b0dbbcd6039810cbc76b9f6e81 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)