Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Foundation/FileManager+POSIX.swift
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ extension FileManager {

#if !os(WASI) // WASI doesn't have ownership concept
// Set the file permissions using fchmod() instead of when open()ing to avoid umask() issues
let permissions = fileInfo.st_mode & ~S_IFMT
let permissions = fileInfo.st_mode & ~mode_t(S_IFMT)
guard fchmod(dstfd, permissions) == 0 else {
throw _NSErrorWithErrno(errno, reading: false, path: dstPath,
extraUserInfo: extraErrorInfo(srcPath: srcPath, dstPath: dstPath, userVariant: variant))
Expand Down
2 changes: 2 additions & 0 deletions Sources/Foundation/FileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,8 @@ open class FileManager : NSObject {
return Int(mode & ~UInt32(ucrt.S_IFMT))
#elseif canImport(Darwin)
return Int(mode & ~UInt32(S_IFMT))
#elseif canImport(Android)
return Int(mode & ~mode_t(S_IFMT))
#else
return Int(mode & ~S_IFMT)
#endif
Expand Down