REBOL3 tracker
  0.9.12 beta
Ticket #0001894 User: anonymous

Project:

Previous Next
rss
TypeBug Statuspending Date12-Oct-2011 13:51
Versionalpha 111 CategoryPorts Submitted byLadislav
PlatformAll Severitycrash Prioritynormal

Summary APPEND file-port crash
Description The code below crashes the interpreter
Example code
port: open/new %pokus.txt
append port newline

Assigned ton/a Fixed in- Last Update25-Apr-2015 23:09


Comments
(0003209)
BrianH
12-Oct-2011 18:43

File ports don't support the APPEND action - you're supposed to use WRITE/append instead, like this:

port: open/new %pokus.txt
write/append port to-string newline ; You can't write a character without converting it to string or binary first

Still, it shouldn't crash. The relevant code may be in the host source, and if so we can fix it ourselves.
(0003211)
Ladislav
25-Oct-2011 11:57

in the core-tests suite
(0004370)
abolka
17-Mar-2014 00:14

Currently, APPEND on a file port! is just a shortcut for WRITE/append. Should we keep that behaviour, or disallow APPEND on file port!s altogether, for now?
(0004372)
abolka
23-Mar-2014 12:08

Fix for the crash submitted:
https://github.com/rebol/rebol/pull/212

Note that this fix tightens the effective type spec for APPEND on file ports. Disallowing APPEND on file ports altogether should still be discussed. We could also discuss relaxing APPEND on file ports so that it automatically converts to binary for non-binary values.

Date User Field Action Change
25-Apr-2015 23:09 abolka Status Modified reviewed => pending
23-Mar-2014 12:08 abolka Comment : 0004372 Added -
17-Mar-2014 00:14 abolka Comment : 0004370 Added -
25-Oct-2011 11:57 Ladislav Comment : 0003211 Added -
12-Oct-2011 18:43 BrianH Comment : 0003209 Added -
12-Oct-2011 18:38 BrianH Summary Modified Append port newline crash => APPEND file-port crash
12-Oct-2011 18:38 BrianH Code Modified -
12-Oct-2011 18:38 BrianH Category Modified Native => Ports
12-Oct-2011 18:38 BrianH Status Modified submitted => reviewed
12-Oct-2011 13:51 Ladislav Ticket Added -