File tree 2 files changed +26
-0
lines changed
Files.xcodeproj/project.xcworkspace/xcshareddata 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version =" 1.0" >
4
+ <dict >
5
+ <key >IDEDidComputeMac32BitWarning </key >
6
+ <true />
7
+ </dict >
8
+ </plist >
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ public class FileSystem {
45
45
* to perform operations that are supported by both files & folders.
46
46
*/
47
47
public class Item : Equatable , CustomStringConvertible {
48
+ #if os(macOS)
49
+ /// The attributes of the `FileSystem.Item` on mac os platform.
50
+ public typealias Attributes = [ FileAttributeKey : Any ]
51
+ #endif
48
52
/// Errror type used for invalid paths for files or folders
49
53
public enum PathError : Error , Equatable , CustomStringConvertible {
50
54
/// Thrown when an empty path was given when initializing a file
@@ -213,6 +217,20 @@ public class FileSystem {
213
217
fileprivate let kind : Kind
214
218
fileprivate let fileManager : FileManager
215
219
220
+ #if os(macOS)
221
+ /// The file attributes of the item on file system.
222
+ @available ( macOS 10 . 5 , * )
223
+ public var attributes : Attributes ? {
224
+ get {
225
+ return try ? fileManager. attributesOfItem ( atPath: path)
226
+ }
227
+
228
+ set {
229
+ try ? fileManager. setAttributes ( newValue ?? [ : ] , ofItemAtPath: path)
230
+ }
231
+ }
232
+ #endif
233
+
216
234
fileprivate init ( path: String , kind: Kind , using fileManager: FileManager ) throws {
217
235
guard !path. isEmpty else {
218
236
throw PathError . empty
You can’t perform that action at this time.
0 commit comments