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 15
15
import Glibc
16
16
#elseif os(Windows)
17
17
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
18
25
#else
19
26
#error("Unsupported platform")
20
27
#endif
@@ -49,7 +56,7 @@ if errFile != -1 {
49
56
}
50
57
51
58
// CHECK-NOT: error
52
- // CHECK: created mode *33216* *33216*
59
+ // CHECK: created mode *{{ 33216|33060}} * *{{ 33216|33060}} *
53
60
let tempFile =
54
61
open ( tempPath, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IXUSR)
55
62
if tempFile == - 1 {
@@ -84,6 +91,10 @@ if err != 0 {
84
91
85
92
print ( " created mode * \( statbuf1. st_mode) * * \( statbuf2. st_mode) * " )
86
93
94
+ #if os(Windows)
95
+ assert ( statbuf1. st_mode == S_IFREG | S_IRUSR | S_IRGRP | S_IROTH)
96
+ #else
87
97
assert ( statbuf1. st_mode == S_IFREG | S_IRUSR | S_IWUSR | S_IXUSR)
98
+ #endif
88
99
assert ( statbuf1. st_mode == statbuf2. st_mode)
89
100
You can’t perform that action at this time.
0 commit comments