REBOL3 tracker
  0.9.12 beta
Ticket #0001651 User: anonymous

Project:



rss
TypeBug Statuscomplete Date13-Sep-2010 23:11
Versionalpha 107 CategoryMezzanine Submitted byabolka
PlatformAll Severityminor Prioritynormal

Summary FILE-TYPE? should return NONE for unknown types
Description [updated note]
The example code shows a problem with LOAD that is caused by file-type? returning TEXT for unknown suffixes. It is better to return NONE, then let the calling code decide how to deal with that.
Example code
>> (read %foo.bar) == read %qux
== true

>> (load %foo.bar) == load %qux
== false

>> load %foo.bar
== [1 2 3]
>> load %qux
== "[1 2 3]^/"

Assigned ton/a Fixed inalpha 108 Last Update2-Nov-2010 03:28


Comments
(0002493)
abolka
13-Sep-2010 23:27

May actually be the result of a bug in FILE-TYPE? which reports files without extension to be of type 'text:


>> file-type? %foo
== text
>> file-type? %foo.bar
== none
(0002537)
BrianH
23-Sep-2010 10:16

When the text and markup codecs were added, the file-types list creation code wasn't adjusted to match. If a codec has no suffixes assigned, it shouldn't be in the file-types list. Perhaps we can assign some suffixes to the text and markup codecs, but either way the file-types list creation code needs to be adjusted.
(0002749)
abolka
2-Nov-2010 03:28

In the core-tests suite.

Date User Field Action Change
2-Nov-2010 03:28 abolka Comment : 0002749 Added -
21-Oct-2010 02:37 abolka Status Modified tested => complete
20-Oct-2010 04:14 BrianH Status Modified built => tested
2-Oct-2010 01:52 carl Fixedin Modified => alpha 108
2-Oct-2010 01:52 carl Status Modified reviewed => built
2-Oct-2010 01:35 carl Summary Modified LOAD behaviour differs between file with unknown extension and file without an extension => FILE-TYPE? should return NONE for unknown types
2-Oct-2010 01:35 carl Description Modified -
23-Sep-2010 10:16 BrianH Comment : 0002537 Added -
20-Sep-2010 22:07 carl Code Modified -
20-Sep-2010 22:07 carl Status Modified submitted => reviewed
13-Sep-2010 23:27 abolka Comment : 0002493 Added -
13-Sep-2010 23:11 abolka Ticket Added -