<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1781803551;
mso-list-template-ids:980825942;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link="#467886" vlink="#96607D" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>In the description of the "input" statement, The Therion Book states:<o:p></o:p></p><p class=MsoNormal>"Default extension is .th and may be omitted."<o:p></o:p></p><p class=MsoNormal>I understand this to mean that:<o:p></o:p></p><p class=MsoNormal>“input bigcave” is equivalent to: “input bigcave.th” rather than meaning that an actual extensionless file named "bigcave" is also a valid Therion source.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Both "input" and "source" ultimately use thinput to open files. The filename-resolution logic appears to try an extensionless pathname before applying the configured extensions. Thus, given:<o:p></o:p></p><p class=MsoNormal>“input bigcave”<o:p></o:p></p><p class=MsoNormal>Therion effectively tries:<o:p></o:p></p><p class=MsoNormal>bigcave<br>bigcave.th<br>bigcave.th2<o:p></o:p></p><p class=MsoNormal>stopping at the first pathname it can open.<o:p></o:p></p><p class=MsoNormal>This causes a platform-dependent failure if a directory called "bigcave" exists alongside "bigcave.th".<o:p></o:p></p><p class=MsoNormal>Under Windows, attempting to open the directory as an input stream fails, so Therion continues and successfully opens "bigcave.th".<o:p></o:p></p><p class=MsoNormal>Under Linux, opening the directory as an input stream succeeds. Therion therefore accepts the directory as its source and subsequently attempts to read it as a text file. The stream enters a failure state, which Therion reports with the misleading fatal error:<o:p></o:p></p><p class=MsoNormal>“Line too long”<o:p></o:p></p><p class=MsoNormal>The same problem occurs with "source".<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Minimal reproduction:<o:p></o:p></p><p class=MsoNormal>Create a directory containing:<o:p></o:p></p><p class=MsoNormal>thconfig<br>bigcave.th<br>bigcave/ (an empty directory)<o:p></o:p></p><p class=MsoNormal>with thconfig containing:<o:p></o:p></p><p class=MsoNormal>“source bigcave”<o:p></o:p></p><p class=MsoNormal>and bigcave.th containing valid Therion source.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On Linux this fails with "line too long". Any of the following makes it work:<o:p></o:p></p><ul style='margin-top:0cm' type=disc><li class=MsoNormal style='mso-list:l0 level1 lfo1'>Change the configuration to "source bigcave.th". <o:p></o:p></li><li class=MsoNormal style='mso-list:l0 level1 lfo1'>Remove or rename the "bigcave" directory. <o:p></o:p></li><li class=MsoNormal style='mso-list:l0 level1 lfo1'>Compile the same ambiguous project under Windows. <o:p></o:p></li></ul><p class=MsoNormal>This suggests that the underlying problem is that "the .th extension may be omitted" has been implemented as "first try opening the extensionless pathname" rather than "if the extension is omitted, use the default .th extension."<o:p></o:p></p><p class=MsoNormal>There is a related issue with using the same generic filename-resolution mechanism for both "source" and "input". I believe the intended semantics are:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:36.0pt'>input bigcave -> bigcave.th<br>input bigcave.th -> bigcave.th<br>input bigcave.th2 -> bigcave.th2<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p><p class=MsoNormal style='margin-left:36.0pt'>source bigcave -> bigcave.th<br>source bigcave.th -> bigcave.th<br>source bigcave.th2 -> invalid<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'><o:p> </o:p></p><p class=MsoNormal>An explicitly specified .th2 file is therefore a valid target for "input", but that does not make .th2 an alternative default extension when the extension is omitted. Similarly, an actual extensionless filesystem object is not a valid interpretation of either statement.<o:p></o:p></p><p class=MsoNormal>In other words, thinput appears to test filesystem objects that are not valid interpretations of the Therion statement that invoked it.<o:p></o:p></p><p class=MsoNormal>Resolving the filename according to the semantics of "source" or "input" before attempting to open it would also remove the Windows/Linux difference and prevent a directory from being mistaken for a Therion source file.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal>Mike<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>