Remove @dynamicMember generally

This commit is contained in:
Max Howell
2019-07-21 15:28:01 -04:00
parent d2bb2a1fdc
commit 621d1b0160
13 changed files with 198 additions and 131 deletions

View File

@@ -1,6 +1,6 @@
import Foundation
public extension Path {
public extension Pathish {
//MARK: Filesystem Attributes
/**
@@ -38,7 +38,7 @@ public extension Path {
@discardableResult
func chmod(_ octal: Int) throws -> Path {
try FileManager.default.setAttributes([.posixPermissions: octal], ofItemAtPath: string)
return self
return Path(self)
}
/**
@@ -57,7 +57,7 @@ public extension Path {
try FileManager.default.setAttributes(attrs, ofItemAtPath: string)
}
#endif
return self
return Path(self)
}
/**
@@ -73,7 +73,7 @@ public extension Path {
do {
attrs = try FileManager.default.attributesOfItem(atPath: string)
} catch CocoaError.fileReadNoSuchFile {
return self
return Path(self)
}
let b = attrs[.immutable] as? Bool ?? false
if b {
@@ -81,14 +81,10 @@ public extension Path {
try FileManager.default.setAttributes(attrs, ofItemAtPath: string)
}
#endif
return self
return Path(self)
}
enum Kind {
case file, symlink, directory
}
var kind: Kind? {
var kind: Path.Kind? {
var buf = stat()
guard lstat(string, &buf) == 0 else {
return nil
@@ -102,3 +98,9 @@ public extension Path {
}
}
}
public extension Path {
enum Kind {
case file, symlink, directory
}
}