File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 76
76
if (GET_FLAG (file -> modes , RFM_NAME_MEM )) {
77
77
//NOTE: file->file.path will get GC'd
78
78
file -> file .path = 0 ;
79
+ file -> file .index = 0 ;
79
80
CLR_FLAG (file -> modes , RFM_NAME_MEM );
80
81
}
81
82
SET_CLOSED (file );
Original file line number Diff line number Diff line change @@ -152,6 +152,22 @@ if system/platform = 'Windows [
152
152
--assert "<foo>" = read /string write %foo <foo >
153
153
delete %foo
154
154
155
+ --test- "open/close file"
156
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/1456
157
+ file: %tmp-1456
158
+ write file "abc"
159
+ --assert #{ 616263 } = read file
160
+ port: open file
161
+ --assert #{ 616263 } = read port
162
+ --assert open? port
163
+ --assert empty? read port ; because the port is still open, but we are at tail already
164
+ close port
165
+ --assert not open? port
166
+ --assert #{ 616263 } = read port ;port was not one, so it's opened for read action
167
+ --assert not open? port ;but was closed again by read
168
+ --assert #{ 616263 } = read port ;so next read is again full
169
+ delete %tmp-1456
170
+
155
171
===end-group===
156
172
157
173
===start-group=== "HTTP scheme"
You can’t perform that action at this time.
0 commit comments