Using custom FileManager attributes for DiskStorage #1792
-
Hello, I am wondering what would be the best way to pass any additional attributes to the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
From my quick research - it seems like the best place to do so would be here(existing files) and here(new files) but wondering about possible alternatives that can be used at the moment |
Beta Was this translation helpful? Give feedback.
-
Something that I am planning to propose it to have updated public func store(
value: T,
forKey key: String,
writingOptions: NSData.WritingOptions = [],
expiration: StorageExpiration? = nil) throws
{
...
do {
try data.write(to: fileURL, options: writingOptions)
}
...
} would still need to figure out the best way to tackle already existing files, potentially it's going to look like: public func store(
value: T,
forKey key: String,
writingOptions: NSData.WritingOptions = [],
additionalAttributes: [FileAttributeKey: Any] = [:],
expiration: StorageExpiration? = nil) throws {...} Where we are going to merge "default" attributes with additional ones |
Beta Was this translation helpful? Give feedback.
-
Merged here #1793 |
Beta Was this translation helpful? Give feedback.
Merged here #1793