@@ -132,8 +132,8 @@ struct FileDescriptorPathSecureTests {
132132 let attrs = try FileManager . default. attributesOfItem ( atPath: dirPath. string)
133133 let posixPerms = attrs [ . posixPermissions] as? NSNumber
134134 // Mask to permission bits only (not file type bits)
135- let permMask : UInt16 = 0o777
136- let actualPerms = ( posixPerms? . uint16Value ?? 0 ) & permMask
135+ let permMask : CModeT = 0o777
136+ let actualPerms = CModeT ( posixPerms? . uint16Value ?? 0 ) & permMask
137137 let expectedPerms = permissions. rawValue & permMask
138138 #expect(
139139 actualPerms == expectedPerms,
@@ -396,7 +396,7 @@ struct FileDescriptorPathSecureTests {
396396
397397 // Create a regular file
398398 let filePath = tempPath. appending ( " testfile.txt " )
399- FileManager . default. createFile ( atPath: filePath. string, contents: Data ( " test " . utf8) )
399+ _ = FileManager . default. createFile ( atPath: filePath. string, contents: Data ( " test " . utf8) )
400400
401401 // Verify file exists
402402 #expect( FileManager . default. fileExists ( atPath: filePath. string) )
@@ -452,9 +452,9 @@ struct FileDescriptorPathSecureTests {
452452 let deepdirPath = subdirPath. appending ( " deepdir " )
453453
454454 try FileManager . default. createDirectory ( atPath: deepdirPath. string, withIntermediateDirectories: true )
455- FileManager . default. createFile ( atPath: nestedPath. appending ( " file1.txt " ) . string, contents: Data ( " 1 " . utf8) )
456- FileManager . default. createFile ( atPath: subdirPath. appending ( " file2.txt " ) . string, contents: Data ( " 2 " . utf8) )
457- FileManager . default. createFile ( atPath: deepdirPath. appending ( " file3.txt " ) . string, contents: Data ( " 3 " . utf8) )
455+ _ = FileManager . default. createFile ( atPath: nestedPath. appending ( " file1.txt " ) . string, contents: Data ( " 1 " . utf8) )
456+ _ = FileManager . default. createFile ( atPath: subdirPath. appending ( " file2.txt " ) . string, contents: Data ( " 2 " . utf8) )
457+ _ = FileManager . default. createFile ( atPath: deepdirPath. appending ( " file3.txt " ) . string, contents: Data ( " 3 " . utf8) )
458458
459459 // Verify structure exists
460460 #expect( FileManager . default. fileExists ( atPath: nestedPath. string) )
@@ -491,7 +491,7 @@ struct FileDescriptorPathSecureTests {
491491 // Create target file and symlink
492492 let targetPath = tempPath. appending ( " target.txt " )
493493 let linkPath = tempPath. appending ( " link " )
494- FileManager . default. createFile ( atPath: targetPath. string, contents: Data ( " target " . utf8) )
494+ _ = FileManager . default. createFile ( atPath: targetPath. string, contents: Data ( " target " . utf8) )
495495 try FileManager . default. createSymbolicLink ( atPath: linkPath. string, withDestinationPath: " target.txt " )
496496
497497 // Verify both exist
@@ -523,7 +523,7 @@ struct FileDescriptorPathSecureTests {
523523 let subdirPath = mixedPath. appending ( " subdir " )
524524
525525 try FileManager . default. createDirectory ( atPath: subdirPath. string, withIntermediateDirectories: true )
526- FileManager . default. createFile ( atPath: mixedPath. appending ( " file.txt " ) . string, contents: Data ( " test " . utf8) )
526+ _ = FileManager . default. createFile ( atPath: mixedPath. appending ( " file.txt " ) . string, contents: Data ( " test " . utf8) )
527527 try FileManager . default. createSymbolicLink (
528528 atPath: mixedPath. appending ( " link " ) . string,
529529 withDestinationPath: " file.txt "
@@ -643,7 +643,7 @@ struct FileDescriptorPathSecureTests {
643643 attributes: permissions. map { [ . posixPermissions: $0. rawValue] }
644644 )
645645 }
646- FileManager . default. createFile (
646+ _ = FileManager . default. createFile (
647647 atPath: fullPath. string,
648648 contents: Data ( " test " . utf8)
649649 )
0 commit comments