[Coco] Run Time Error 203 "Illegal Mode"

coco at jechar.ca coco at jechar.ca
Tue Aug 11 15:59:56 EDT 2020


Actually I am going to do a drastically different version that will
require a complete rewrite. Also the current version depends on
ls outputting only one file per line which was the old standard
however newer versions of ls like the one in EOU do not work
this way.

By the way I had tried update and still had problems. It may be
coming from the change in how ls operates.

Charlie.

On 2020-08-11 15:39, Doug Fraser wrote:
> That may be a better option to use UPDATE as, if I'm not mistaken,
> having the temp file in read mode may be causing the problem as you're
> using touch and del which would try to write updates to the file.
> 
> Get Outlook for Android<https://aka.ms/ghei36>
> 
> ________________________________
> From: Coco <coco-bounces at maltedmedia.com> on behalf of coco at jechar.ca
> <coco at jechar.ca>
> Sent: Tuesday, August 11, 2020 10:27:26 AM
> To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
> Subject: Re: [Coco] Run Time Error 203 "Illegal Mode"
> 
> If I were to just change :READ to :UPDATE would Basic09 wait for a
> lock that ls had put on the file automatically ? Also
> is SHELL "touch /dd/TMP/dirlist.tmp;del /dd/TMP/dirlist.tmp;ls
>  >/dd/TMP/dirlist.tmp" preferable or worse ?
> 
> On 2020-08-10 18:19, Rick Ulland wrote:
>> Just spitballin', I guess scheduling and would try eliminating the 3
>> sequential forks to shell. Don't touch, just delete the temp file from
>> inside B09 (DELETE "pathname"), and since 'ls' is an external program,
>> maybe waste a little time inside B09 so the SHELL ls  command can wrap
>> up and close the file before you OPEN read mode.
>> 
>> -ricku
>> CoNect
>> 
>> 
>> On 8/10/20 2:47 PM, Wayne Campbell wrote:
>>> There are a number of places where a 203 error could occur in this
>>> code,
>>> but none of them seems to be incorrect on the surface. If your module
>>> is
>>> small enough, and you can run it in the Basic09 editing environment, 
>>> I
>>> suggest using TRON and TROFF and then stepping through the code to 
>>> see
>>> what
>>> error gets generated on which line. In my experience, a system level
>>> error
>>> may not always be the exact error occurring, and it may be something
>>> that
>>> will fall under a Basic09 error code in debug mode.
>>> 
>>> I'm not sure why you are using the touch command, unless it's just to
>>> make
>>> sure the file exists, but that has nothing to do with the error you
>>> are
>>> getting.
>>> 
>>> Wayne
>>> 
>>> The Structure of I-Code
>>> http://www.cocopedia.com/wiki/index.php/The_Structure_of_I-Code
>>> 
>>> 
>>> 
>>> On Mon, Aug 10, 2020 at 12:34 PM <coco at jechar.ca> wrote:
>>> 
>>>> On 2020-08-10 16:10, Wayne Campbell wrote:
>>>>> OK. I had to refresh my memory and make sure I was remembering the
>>>>> 203
>>>>> error correctly. 203 is an input/output error. Generally, it means
>>>>> you
>>>>> are
>>>>> attempting to operate in a file in a manner not consistent with the
>>>>> way
>>>>> you
>>>>> opened or created it. Usually, it means you are attempting to write
>>>>> to
>>>>> a
>>>>> read only file (:READ) or read from a write only file (:WRITE). If
>>>>> it
>>>>> isn't
>>>>> a file, then you are operating on a module as input that should be
>>>>> output
>>>>> or vice-versa.
>>>>> 
>>>>> I agree with what Curtis wrote. You should provide some code here
>>>>> that
>>>>> can
>>>>> help us determine where the problem is occuring.
>>>>> 
>>>>> Wayne
>>>>> 
>>>>> 
>>>>> On Mon, Aug 10, 2020 at 10:51 AM <coco at jechar.ca> wrote:
>>>>> 
>>>>>> I have a basic09 module the source compiles fine but when
>>>>>> I try to run it it gives an error 203.
>>>>>> 
>>>>>> Not sure where to even start to figure out what's wrong.
>>>>>> Would anyone know what are the most common sources of a 203 error 
>>>>>> ?
>>>>>> 
>>>>>> Charlie
>>>>>> 
>>>>>> --
>>>>>> Coco mailing list
>>>>>> Coco at maltedmedia.com
>>>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>>>> 
>>>> The Code two related GOSUB subroutines.
>>>> 
>>>> (* Subroutines *)
>>>> 100 (* CAPS last setup tem-file *)
>>>> SHELL "touch /dd/TEMP/dirlist.tmp"
>>>> SHELL "del /dd/TEMP/dirlist.tmp"
>>>> SHELL "ls > /dd/TEMP/dirlist.tmp"
>>>> RETURN
>>>> 200 (* CAPS last *)
>>>> GOSUB 100
>>>> OPEN #fp,"/dd/TEMP/dirlist.tmp":READ
>>>> WHILE NOT EOF(#fp) DO
>>>>      READ #fp,line$
>>>>      tc=ASC(MID$(line$,1,1))
>>>>      cv=LEN(line$)
>>>>      IF cv<25 THEN
>>>>         IF tc<97 THEN
>>>>            SHELL"RENAME "+line$+" zzz"+line$
>>>>         ENDIF
>>>>      ENDIF
>>>> ENDWHILE
>>>> CLOSE #fp
>>>> SHELL "DIRSORT"
>>>> GOSUB 100
>>>> OPEN #fp,"/dd/TEMP/dirlist.tmp":READ
>>>> WHILE NOT EOF(#fp) DO
>>>>      READ #fp,line$
>>>>      c$=MID$(line$,1,3)
>>>>      cv=LEN(line$)
>>>>      IF c$="zzz" THEN
>>>>         c$=RIGHT$(line$,(cv-3))
>>>>         SHELL "RENAME "+line$+" "+c$
>>>>      ENDIF
>>>> ENDWHILE
>>>> CLOSE #fp
>>>> RETURN
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Coco mailing list
>>>> Coco at maltedmedia.com
>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>> 
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list