My thought here is that, however scarce its actual occurrence is, it should be 
in line with what Rexx on z/OS does.
This is what happens on USS which has the stream I/O package:

# cat testchar.rexx 
/* rexx */
call on error name notready

f = "inputfile.txt" 

say "open" stream(f, "c", "open")                  

say "charout" charout(f)                     
say "close" stream(f, "c", "close")  
           
say "open" stream(f, "c", "open read")    
say "charout" charout(f)                    
                                     
say "close" stream(f, "c", "close")    

exit

notready:
say "notready raised" 
return

# ./testchar.rexx
open 502456696
charout 0
close READY
open 502456632
charout 0
close READY
# 


best regards,

René.

> On 20 aug. 2016, at 11:41, Erich Steinböck <[email protected]> wrote:
> 
> We have an open [documentation:200] bug identifying a quirk with CHAROUT(), 
> which is supposed to close a file, if neither string nor start arg is given.  
> But as you can see from below test case, CHAROUT() will only close the file 
> if it was opened in R/W mode; it will raise NOTREADY and not close a file if 
> it was opened as R/O.
> 
> (The equivalent .Stream methods show the same issue as above).
> 
> Is this behavior intended, and as such we should document it?
> Or is this an interpreter bug?
> 
> call on notready
> 
> f = "\temp\inputfile.txt"
> 
> say "open" stream(f, "c", "open")      --> open READY:     
> say "charout" charout(f)               --> charout 0       
> say "close" stream(f, "c", "close")    --> close
>            
> say "open" stream(f, "c", "open read") --> open READY:     
> say "charout" charout(f)               --> charout 0       
>                                        --> notready raised 
> say "close" stream(f, "c", "close")    --> close READY:    
> 
> exit
> 
> notready:
> say "notready raised"
> return
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel

------------------------------------------------------------------------------
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to