REBOL3 tracker
  0.9.12 beta
Ticket #0001456 User: anonymous

Project:



rss
TypeBug Statustested Date5-Feb-2010 08:43
Versionalpha 96 CategoryPorts Submitted bysqlab
PlatformWindows Severitymajor Priorityhigh

Summary open does not reset the internal file pointer of a previously closed file port
Description open on a file port, that was previously closed, does not reset the file pointer to the beginning of the file.
Therefore the data can be read only once.
This applies to read as to copy .
Example code
>> write %test "abcdefg"
>> read %test
== #{61626364656667}
>> f: open %test
>> read f
== #{61626364656667}

>> close f
>> read f
== #{}
>> open f
>> read f
== #{}


Assigned ton/a Fixed inalpha 98 Last Update6-May-2010 09:17


Comments
(0001993)
pekr
7-Feb-2010 18:07

Interesting that consecutive call to 'close seems to cure the situation. We are dealing with probably internally two different behaviours to 'read? One is direct read of the file, while the other one, where we 'open the file port first, calls port 'read actor?
(0002324)
Carl
6-May-2010 01:24

The bug is fixed. Both of the #{} strings now contain the file contents.

NOTE: The READ f is allowed even when port is not open, because f is a valid port spec and we allow a direct read on such ports.

Please be sure to test this change really well. Thanks.

Date User Field Action Change
6-May-2010 09:17 BrianH Status Modified built => tested
6-May-2010 01:25 carl Comment : 0002324 Modified -
6-May-2010 01:24 carl Comment : 0002324 Added -
6-May-2010 01:22 carl Fixedin Modified => alpha 98
6-May-2010 01:22 carl Status Modified submitted => built
7-Feb-2010 18:07 pekr Comment : 0001993 Added -
5-Feb-2010 21:37 BrianH Category Modified Native => Ports
5-Feb-2010 10:19 sqlab Description Modified -
5-Feb-2010 10:19 sqlab Code Modified -
5-Feb-2010 10:19 sqlab Version Modified alpha 97 => alpha 96
5-Feb-2010 08:43 sqlab Ticket Added -