You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Foundation/FileManager.swift
+22-33Lines changed: 22 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
// This source file is part of the Swift.org open source project
2
2
//
3
-
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
3
+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
4
4
// Licensed under Apache License v2.0 with Runtime Library Exception
5
5
//
6
-
// See http://swift.org/LICENSE.txt for license information
7
-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
6
+
// See https://swift.org/LICENSE.txt for license information
7
+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8
8
//
9
9
10
10
#if os(macOS) || os(iOS)
@@ -342,16 +342,7 @@ open class FileManager : NSObject {
342
342
result[.groupOwnerAccountName]= name
343
343
}
344
344
345
-
vartype:FileAttributeType
346
-
switch s.st_mode & S_IFMT {
347
-
case S_IFCHR: type =.typeCharacterSpecial
348
-
case S_IFDIR: type =.typeDirectory
349
-
case S_IFBLK: type =.typeBlockSpecial
350
-
case S_IFREG: type =.typeRegular
351
-
case S_IFLNK: type =.typeSymbolicLink
352
-
case S_IFSOCK: type =.typeSocket
353
-
default: type =.typeUnknown
354
-
}
345
+
lettype=FileAttributeType(statMode: s.st_mode)
355
346
result[.type]= type
356
347
357
348
if type ==.typeBlockSpecial || type ==.typeCharacterSpecial {
@@ -426,7 +417,7 @@ open class FileManager : NSObject {
426
417
})
427
418
}
428
419
429
-
/* destinationOfSymbolicLinkAtPath:error: returns an NSString containing the path of the item pointed at by the symlink specified by 'path'. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter.
420
+
/* destinationOfSymbolicLinkAtPath:error: returns a String containing the path of the item pointed at by the symlink specified by 'path'. If this method returns 'nil', an NSError will be thrown.
430
421
431
422
This method replaces pathContentOfSymbolicLinkAtPath:
432
423
*/
@@ -535,13 +526,11 @@ open class FileManager : NSObject {
0 commit comments