1

Topic: TR-DOS: Sequential file streams - Invalid stream on open for read

Hi,

I was trying to use the file streams with TR-DOS and found a bug: opening streams for writing works, but opening for read always returns 'Ivalid stream' error.

Here is a sample programs that work on FUSE with Betadisk enabled:

   10 LET DOS=15619
   11 PRINT "DELETING DATA FILE"
   12 RANDOMIZE USR DOS: REM : ERASE "DATA"#
   15 PRINT "OPENING WRITE STREAM"
   20 RANDOMIZE USR DOS: REM : OPEN #4,"DATA",W
   25 PRINT "WRITING"
   30 PRINT #4;"DATA LINE 2"
   35 PRINT "CLOSING"
   40 RANDOMIZE USR DOS: REM : CLOSE #4
   45 PRINT "OPENING READ STREAM"
   50 RANDOMIZE USR DOS: REM : OPEN #4,"DATA",R
   55 PRINT "READING"
   60 INPUT #4;A$: PRINT A$
   65 PRINT "CLOSING"
   70 RANDOMIZE USR 15619: REM : CLOSE #4
   75 PRINT "DONE"

The error is thrown at line 50.