Skip to content

Commit f872d2b

Browse files
committed
Foundation: repair android ARMv7 builds
``` D:/a/1/s/swift-corelibs-foundation/Foundation/FileManager.swift:563:50: error: cannot convert value of type 'UInt32' to expected argument type 'mode_t' (aka 'UInt16') let type = FileAttributeType(statMode: s.st_mode) ~~^~~~~~~ mode_t( ) ```
1 parent bbfd56e commit f872d2b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Foundation/FileManager+POSIX.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ extension FileManager {
591591
internal func _copyOrLinkDirectoryHelper(atPath srcPath: String, toPath dstPath: String, variant: String = "Copy", _ body: (String, String, FileAttributeType) throws -> ()) throws {
592592
let stat = try _lstatFile(atPath: srcPath)
593593

594-
let fileType = FileAttributeType(statMode: stat.st_mode)
594+
let fileType = FileAttributeType(statMode: mode_t(stat.st_mode))
595595
if fileType == .typeDirectory {
596596
try createDirectory(atPath: dstPath, withIntermediateDirectories: false, attributes: nil)
597597

@@ -603,7 +603,7 @@ extension FileManager {
603603
let src = srcPath + "/" + item
604604
let dst = dstPath + "/" + item
605605
if let stat = try? _lstatFile(atPath: src) {
606-
let fileType = FileAttributeType(statMode: stat.st_mode)
606+
let fileType = FileAttributeType(statMode: mode_t(stat.st_mode))
607607
if fileType == .typeDirectory {
608608
try createDirectory(atPath: dst, withIntermediateDirectories: false, attributes: nil)
609609
} else {

Foundation/FileManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ open class FileManager : NSObject {
560560
result[.groupOwnerAccountName] = name
561561
}
562562

563-
let type = FileAttributeType(statMode: s.st_mode)
563+
let type = FileAttributeType(statMode: mode_t(s.st_mode))
564564
#endif
565565
result[.type] = type
566566

0 commit comments

Comments
 (0)