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 {
305305 let grd = getgrgid ( s. st_gid)
306306 if grd != nil && grd!. pointee. gr_name != nil {
307307 let name = String ( cString: grd!. pointee. gr_name)
308- result [ . groupOwnerAccountID ] = name
308+ result [ . groupOwnerAccountName ] = name
309309 }
310310
311311 var type : FileAttributeType
Original file line number Diff line number Diff line change @@ -151,6 +151,23 @@ class TestNSFileManager : XCTestCase {
151151 let fileOwnerAccountID = attrs [ . ownerAccountID] as? NSNumber
152152 XCTAssertNotNil ( fileOwnerAccountID)
153153
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+
154171 } catch let err {
155172 XCTFail ( " \( err) " )
156173 }
You can’t perform that action at this time.
0 commit comments