🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

5 total messages Started by jsbarbe Mon, 15 Apr 1996 03:32
LINEIN Question (another one)
#4689
Author: jsbarbe
Date: Mon, 15 Apr 1996 03:32
18 lines
1284 bytes
I can't figure out why my WARP REXX program fails.  It is looping through files 
(obtained  with SysFileTree) and using LINEIN to read all the lines of each 
file and write them to a single output file.  WORKS GREAT until it hits the 32nd
file then it thinks all subsequent files have no lines.  ie ... while lines(readfile) > 1
finds a 0.  

First I set READFILE to be the path and file name from the SysFileTree.
The read loop is preceded by a LINEIN(READFILE,1,0)   (to make sure it's on 1st line)
The LINEIN in the read loop is:   LINEIN(READFILE)

It's NOT the 32nd file, since I can move it to another directory where it is within
the first 30 files and it reads fine 

It's not the subdirectory ... I've tried several and they all seem to fail at 32nd file.

Is there some limit of "open files" that I must close after reading?  Do I do that 
with a STREAM command?
.. I'm stumped.  Any ideas?  Thanks, Steve
Re: LINEIN Question (another one)
#4718
Author: John Alvord
Date: Tue, 16 Apr 1996 15:09
23 lines
1485 bytes
jsbarbe@ibm.net wrote:
: I can't figure out why my WARP REXX program fails.  It is looping 
through files 
: (obtained  with SysFileTree) and using LINEIN to read all the lines of each 
: file and write them to a single output file.  WORKS GREAT until it hits the 32nd
: file then it thinks all subsequent files have no lines.  ie ... while lines(readfile) > 1
: finds a 0.  
: 
: First I set READFILE to be the path and file name from the SysFileTree.
: The read loop is preceded by a LINEIN(READFILE,1,0)   (to make sure it's on 1st line)
: The LINEIN in the read loop is:   LINEIN(READFILE)
: 
: It's NOT the 32nd file, since I can move it to another directory where it is within
: the first 30 files and it reads fine 
: 
: It's not the subdirectory ... I've tried several and they all seem to fail at 32nd file.
: 
: Is there some limit of "open files" that I must close after reading?  Do I do that 
: with a STREAM command?
: .. I'm stumped.  Any ideas?  Thanks, Steve
add a x=lineout(fn) after finishing each file processing.

john alvord
Re: LINEIN Question (another one)
#4717
Author: Mark VanTassel
Date: Tue, 16 Apr 1996 15:32
13 lines
757 bytes
jsbarbe@ibm.net wrote:


>Is there some limit of "open files" that I must close after reading?  Do I do that 
>with a STREAM command?
>.. I'm stumped.  Any ideas?  Thanks, Steve

Bingo - try:  rc=stream(filename, "C", "Close")

(I think that's right - it's been a couple of years)


- /\/\ark \/anTassel (mvantassel@teambca.com)
Re: LINEIN Question (another one)
#4728
Author: warren
Date: Tue, 16 Apr 1996 21:46
33 lines
1997 bytes
In <4l0d7c$moj@cloud9.net>, jalvo@cloud9.net (John Alvord) writes:
>jsbarbe@ibm.net wrote:
>: I can't figure out why my WARP REXX program fails.  It is looping 
>through files 
>: (obtained  with SysFileTree) and using LINEIN to read all the lines of each 
>: file and write them to a single output file.  WORKS GREAT until it hits the 32nd
>: file then it thinks all subsequent files have no lines.  ie ... while lines(readfile) > 1
>: finds a 0.  
>: 
>: First I set READFILE to be the path and file name from the SysFileTree.
>: The read loop is preceded by a LINEIN(READFILE,1,0)   (to make sure it's on 1st line)
>: The LINEIN in the read loop is:   LINEIN(READFILE)
>: 
>: It's NOT the 32nd file, since I can move it to another directory where it is within
>: the first 30 files and it reads fine 
>: 
>: It's not the subdirectory ... I've tried several and they all seem to fail at 32nd file.
>: 
>: Is there some limit of "open files" that I must close after reading?  Do I do that 
>: with a STREAM command?
>: .. I'm stumped.  Any ideas?  Thanks, Steve
>add a x=lineout(fn) after finishing each file processing.
>
>john alvord
His question on the limit of "open files" is:  the number of "file handles" defined in 
your operating system is just that.  Early editions of Warp dropped from the 
common 90 count to the low thirties.

In any event, it is always a good practice to close any files that you have finished 
processing.  You can also use the stream command to close your files.

Warren
http://www.borg.com/~warren
Re: LINEIN Question (another one)
#4768
Author: Peter Hansen
Date: Fri, 19 Apr 1996 14:09
24 lines
1476 bytes
In <4l042d$mih@news1.is.net>, mvantassel@teambca.com (Mark VanTassel) writes:
>jsbarbe@ibm.net wrote:
>
>
>>Is there some limit of "open files" that I must close after reading?  Do I do that
>>with a STREAM command?
>>.. I'm stumped.  Any ideas?  Thanks, Steve
>
>Bingo - try:  rc=stream(filename, "C", "Close")

Or to avoid mixing stream() calls with a bunch of linein/lineout calls,
just use one of:

 dummy = lineout(filename,,)        /* close file */
 call lineout filename              /* close file */

According to the REXX documentation in OS/2, either of the above close
the stream/file "in environments that support the concept".

------------------------------------------------------------------------
 Peter HANSEN                                     Engenuity Corporation
 peter@engcorp.com                              Guelph, Ontario, Canada
 http://www.engcorp.com/peter/
------------------------------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads