File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1515 import Glibc
1616#elseif os(Windows)
1717 import MSVCRT
18+
19+ let S_IRUSR : Int32 = ucrt. _S_IREAD
20+ let S_IWUSR : Int32 = 0
21+ let S_IXUSR : Int32 = 0
22+
23+ let S_IRGRP : Int32 = 0o0040
24+ let S_IROTH : Int32 = 0o0004
1825#else
1926#error("Unsupported platform")
2027#endif
@@ -49,7 +56,7 @@ if errFile != -1 {
4956}
5057
5158// CHECK-NOT: error
52- // CHECK: created mode *33216* *33216*
59+ // CHECK: created mode *{{ 33216|33060}} * *{{ 33216|33060}} *
5360let tempFile =
5461 open ( tempPath, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IXUSR)
5562if tempFile == - 1 {
@@ -84,6 +91,10 @@ if err != 0 {
8491
8592print ( " created mode * \( statbuf1. st_mode) * * \( statbuf2. st_mode) * " )
8693
94+ #if os(Windows)
95+ assert ( statbuf1. st_mode == S_IFREG | S_IRUSR | S_IRGRP | S_IROTH)
96+ #else
8797assert ( statbuf1. st_mode == S_IFREG | S_IRUSR | S_IWUSR | S_IXUSR)
98+ #endif
8899assert ( statbuf1. st_mode == statbuf2. st_mode)
89100
You can’t perform that action at this time.
0 commit comments