Subj : close file in REXX
To : Bryan Rubingh
From : Murray Lesser
Date : Thu Aug 03 2000 02:51 am
(Excerpts from a message dated 08-02-00, Bryan Rubingh to All)
Hi Brian--
BR>I've written a REXX program which reads one file, changes a few
>lines as it reads and writes to a second file, doing the above one
>line at a time. When it reaches the end of the first file, I want
>to copy the second file (the one REXX created) to another location.
>I've tried just doing:
>copy file2 file3
>but I get an OS/2 error when running the program that file2 is in
>use. Is there any way in REXX to close the file so that the OS can
>copy it?
You have some other error, if file2 is the newly-created file. There
is no OS/2 restriction against copying an open file to another file.
There _is_ a restriction against copying a file _to_ an open file.
In any case, in answer to your query, use the stream function:
Call STREAM file2, 'c', 'close' /* file2 is the "from" file */
Next time, post your REXX queries in the OS2REXX echo. You have a
possibility of finding more REXX gurus there :-). In any case, more
REXX users are likely to learn something from your query and the
replies.
Regards,
--Murray
<Team PL/I>
___
* MR/2 2.30 #120 * One printed manual is worth a thousand INF files
--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)