@@ -17,11 +17,10 @@ final public class DiskStorage<Key: Hashable, Value> {
1717
1818 private let transformer : Transformer < Value >
1919 private let hasher = Hasher . constantAccrossExecutions ( )
20- private var defaultFileAttributes : [ FileAttributeKey : Any ] ?
20+ // private var defaultFileAttributes: [FileAttributeKey : Any]?
2121
2222 // MARK: - Initialization
23- public convenience init ( config: DiskConfig , fileManager: FileManager = FileManager . default, transformer: Transformer < Value > ,
24- fileAttributes: [ FileAttributeKey : Any ] = [ : ] ) throws {
23+ public convenience init ( config: DiskConfig , fileManager: FileManager = FileManager . default, transformer: Transformer < Value > ) throws {
2524 let url : URL
2625 if let directory = config. directory {
2726 url = directory
@@ -47,7 +46,7 @@ final public class DiskStorage<Key: Hashable, Value> {
4746 ] )
4847 }
4948
50- defaultFileAttributes = fileAttributes
49+ // defaultFileAttributes = fileAttributes
5150
5251 }
5352
@@ -85,11 +84,11 @@ extension DiskStorage: StorageAware {
8584 let expiry = expiry ?? config. expiry
8685 let data = try transformer. toData ( object)
8786 let filePath = makeFilePath ( for: key)
88- var attributes = defaultFileAttributes!
89- attributes [ . modificationDate] = expiry. date
90-
91- _ = fileManager. createFile ( atPath: filePath, contents: data, attributes: attributes )
92- // try fileManager.setAttributes([.modificationDate: expiry.date], ofItemAtPath: filePath)
87+ // var attributes = defaultFileAttributes!
88+ // attributes[.modificationDate] = expiry.date
89+ //
90+ _ = fileManager. createFile ( atPath: filePath, contents: data, attributes: nil )
91+ try fileManager. setAttributes ( [ . modificationDate: expiry. date] , ofItemAtPath: filePath)
9392 }
9493
9594 public func removeObject( forKey key: Key ) throws {
0 commit comments