Difference in OS/2 Classic/Object REXX Read Only 
Author Message
 Difference in OS/2 Classic/Object REXX Read Only

I have been using the LINEIN function in classic Rexx for OS/2 for years
and have tried
switching to OS/2 ObjRexx.  I can't seem to open a file for READ only
under ObjRexx.
Under ObjRexx I get file concurrency problems. Classic Rexx does no
exhibit this behavior.
What am I missing? For example, The following code will run fine in
multiple sessions
in Classic Rexx, but not ObjRexx.

/* ReXX */

Say ""
Say ""
Say ""

filein='C:\config.sys'

stream_rc=STREAM(filein,'C','OPEN READ')
If stream_rc = 'READY:' Then Do
   Do Until LINES(filein) = 0
       Say LINEIN(filein)
   End
   stream_rc=STREAM(filein,'C','CLOSE')
   'exit'
   End
Else Do
   Say 'stream_rc='||stream_rc
   End
Exit



Wed, 26 Feb 2003 00:48:33 GMT  
 Difference in OS/2 Classic/Object REXX Read Only
This works for ObjRexx for Windows (haven't tried it on my OS/2 machine):

 stream_rc=STREAM(filein,'C','OPEN READ SHARED')
-or-
 stream_rc=STREAM(filein,'C','OPEN READ SHAREREAD')

This does NOT work (file contention problem RC=13):
 stream_rc=STREAM(filein,'C','OPEN SHAREREAD')

I can only guess that the STREAM function was changed with the addition of
new command strings for Object Rexx. In my OS/2 Classic REXX hardcopy
manual, command strings OPEN CLOSE SEEK QUERY exists/size/datetime are the
only ones present. I did not look at the Classic online documentation.

Happy file sharing!


Quote:
> I have been using the LINEIN function in classic Rexx for OS/2 for years
> and have tried
> switching to OS/2 ObjRexx.  I can't seem to open a file for READ only
> under ObjRexx.
> Under ObjRexx I get file concurrency problems. Classic Rexx does no
> exhibit this behavior.
> What am I missing? For example, The following code will run fine in
> multiple sessions
> in Classic Rexx, but not ObjRexx.

> /* ReXX */

> Say ""
> Say ""
> Say ""

> filein='C:\config.sys'

> stream_rc=STREAM(filein,'C','OPEN READ')
> If stream_rc = 'READY:' Then Do
>    Do Until LINES(filein) = 0
>        Say LINEIN(filein)
>    End
>    stream_rc=STREAM(filein,'C','CLOSE')
>    'exit'
>    End
> Else Do
>    Say 'stream_rc='||stream_rc
>    End
> Exit



Wed, 26 Feb 2003 02:23:03 GMT  
 Difference in OS/2 Classic/Object REXX Read Only

Quote:

>I have been using the LINEIN function in classic Rexx for OS/2 for years
>and have tried
>switching to OS/2 ObjRexx.  I can't seem to open a file for READ only
>under ObjRexx.
>Under ObjRexx I get file concurrency problems. Classic Rexx does no
>exhibit this behavior.
>What am I missing? For example, The following code will run fine in
>multiple sessions
>in Classic Rexx, but not ObjRexx.
>stream_rc=STREAM(filein,'C','OPEN READ')

stream_rc=STREAM(filein,'C','OPEN READ SHARED')

Object REXX has more flexible input/output.  If you don't specify SHARED, it
will require exclusive access.

One of the few areas where OREXX won't run a functional CREXX as intended.

--
 - Mike

Remove 'spambegone.net' and reverse to send e-mail.



Wed, 26 Feb 2003 11:29:05 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Rexx Macro Space on Classic OS/2 Rexx

2. Classic Rexx vs. Object Rexx

3. Classic REXX, Object REXX

4. Object REXX vs. Classic REXX

5. Classic REXX versus Object REXX - Is the language losing

6. orexx vv classic rexx steam(,c,seek) difference?

7. A interesting difference between classic and new style objects

8. Handling large file (classic rexx OS/2)

9. Sort function, classic rexx OS/2

10. OS/2 classic REXX, SysTempFileName

11. os/2, classic rexx, and a pm interface

12. A SYS3175 error in classic os/2 rexx

 

 
Powered by phpBB® Forum Software