@@ -879,10 +879,10 @@ extension FileManager {
879
879
do {
880
880
return try _fileSystemRepresentation ( withPath: path, { fsRep in
881
881
var s = try _lstatFile ( atPath: path, withFileSystemRepresentation: fsRep)
882
- if ( s. st_mode & S_IFMT) == S_IFLNK {
882
+ if ( s. st_mode & mode_t ( S_IFMT) ) == mode_t ( S_IFLNK) {
883
883
// don't chase the link for this magic case -- we might be /Net/foo
884
884
// which is a symlink to /private/Net/foo which is not yet mounted...
885
- if isDirectory == nil && ( s. st_mode & S_ISVTX) == S_ISVTX {
885
+ if isDirectory == nil && ( s. st_mode & mode_t ( S_ISVTX) ) == mode_t ( S_ISVTX) {
886
886
return true
887
887
}
888
888
// chase the link; too bad if it is a slink to /Net/foo
@@ -892,7 +892,7 @@ extension FileManager {
892
892
}
893
893
894
894
if let isDirectory = isDirectory {
895
- isDirectory. pointee = ObjCBool ( ( s. st_mode & S_IFMT) == S_IFDIR)
895
+ isDirectory. pointee = ObjCBool ( ( s. st_mode & mode_t ( S_IFMT) ) == S_IFDIR)
896
896
}
897
897
898
898
return true
@@ -956,7 +956,7 @@ extension FileManager {
956
956
let parentS = try _lstatFile ( atPath: path, withFileSystemRepresentation: parentFsRep)
957
957
958
958
// Check if the parent is 'sticky' if it exists.
959
- if ( parentS. st_mode & S_ISVTX) == S_ISVTX {
959
+ if ( parentS. st_mode & mode_t ( S_ISVTX) ) == S_ISVTX {
960
960
let s = try _lstatFile ( atPath: path, withFileSystemRepresentation: fsRep)
961
961
962
962
// If the current user owns the file, return true.
@@ -1070,7 +1070,7 @@ extension FileManager {
1070
1070
defer { fsRep1. deallocate ( ) }
1071
1071
1072
1072
let file1 = try _lstatFile ( atPath: path1, withFileSystemRepresentation: fsRep1)
1073
- let file1Type = file1. st_mode & S_IFMT
1073
+ let file1Type = file1. st_mode & mode_t ( S_IFMT)
1074
1074
1075
1075
// Don't use access() for symlinks as only the contents should be checked even
1076
1076
// if the symlink doesnt point to an actual file, but access() will always try
@@ -1082,7 +1082,7 @@ extension FileManager {
1082
1082
let fsRep2 = try __fileSystemRepresentation ( withPath: path2)
1083
1083
defer { fsRep2. deallocate ( ) }
1084
1084
let file2 = try _lstatFile ( atPath: path2, withFileSystemRepresentation: fsRep2)
1085
- let file2Type = file2. st_mode & S_IFMT
1085
+ let file2Type = file2. st_mode & mode_t ( S_IFMT)
1086
1086
1087
1087
// Are paths the same type: file, directory, symbolic link etc.
1088
1088
guard file1Type == file2Type else {
0 commit comments