File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ open class FileManager : NSObject {
305
305
let grd = getgrgid ( s. st_gid)
306
306
if grd != nil && grd!. pointee. gr_name != nil {
307
307
let name = String ( cString: grd!. pointee. gr_name)
308
- result [ . groupOwnerAccountID ] = name
308
+ result [ . groupOwnerAccountName ] = name
309
309
}
310
310
311
311
var type : FileAttributeType
Original file line number Diff line number Diff line change @@ -151,6 +151,23 @@ class TestNSFileManager : XCTestCase {
151
151
let fileOwnerAccountID = attrs [ . ownerAccountID] as? NSNumber
152
152
XCTAssertNotNil ( fileOwnerAccountID)
153
153
154
+ let fileGroupOwnerAccountID = attrs [ . groupOwnerAccountID] as? NSNumber
155
+ XCTAssertNotNil ( fileGroupOwnerAccountID)
156
+
157
+ if let fileOwnerAccountName = attrs [ . ownerAccountName] {
158
+ XCTAssertNotNil ( fileOwnerAccountName as? String )
159
+ if let fileOwnerAccountNameStr = fileOwnerAccountName as? String {
160
+ XCTAssertFalse ( fileOwnerAccountNameStr. isEmpty)
161
+ }
162
+ }
163
+
164
+ if let fileGroupOwnerAccountName = attrs [ . groupOwnerAccountName] {
165
+ XCTAssertNotNil ( fileGroupOwnerAccountName as? String )
166
+ if let fileGroupOwnerAccountNameStr = fileGroupOwnerAccountName as? String {
167
+ XCTAssertFalse ( fileGroupOwnerAccountNameStr. isEmpty)
168
+ }
169
+ }
170
+
154
171
} catch let err {
155
172
XCTFail ( " \( err) " )
156
173
}
You can’t perform that action at this time.
0 commit comments