Amiga.org

Amiga computer related discussion => Amiga/MorphOS/AROS Programmers Forum => Topic started by: LoadWB on September 16, 2015, 05:11:12 AM

Title: Re-opening a file in A/Rexx
Post by: LoadWB on September 16, 2015, 05:11:12 AM
I am having a problem in Regina trying to open a file for a second time, even after properly closing the file.  This code below

Code: [Select]
/* */

OPTIONS AREXX_BIFS AREXX_SEMANTICS

if open(handle, 'test.bin', 'r') then
   say 'File opened'
else say 'Cannot open file'
   
if close(handle) then
   say 'File closed'
else say 'Cannot close file'

if open(handle, 'test.bin', 'r') then
   say 'File opened'
else say 'Cannot open file'

exit


Results in

Code: [Select]
File opened
File closed
Cannot open file


I am using ARexx symantecs, but my Amiga is disassembled for moving.  Would someone try this out in ARexx and give me the results?  Even better, can someone tell me why this might not work?  I have found a few threads on re-opening files, but they're by the big-iron guys and they talk a lot about EXECIO.