Commit 4a71be9c authored by jabez's avatar jabez

support swift 4.0

parent 6e16483d
...@@ -165,8 +165,15 @@ public class Zip { ...@@ -165,8 +165,15 @@ public class Zip {
let fullPath = destination.appendingPathComponent(pathString).path let fullPath = destination.appendingPathComponent(pathString).path
let creationDate = Date() 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 { do {
if isDirectory { if isDirectory {
try fileManager.createDirectory(atPath: fullPath, withIntermediateDirectories: true, attributes: directoryAttributes) try fileManager.createDirectory(atPath: fullPath, withIntermediateDirectories: true, attributes: directoryAttributes)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment