[comp.lang.icon] VMS Icon 7.0 process cleanup

tenaglia@mis.mcw.edu (Chris Tenaglia - 257-8765) (03/27/90)

I'm running Icon 7.0 on a VAX with VMS 5.2. I've noticed a little problem.

With files this code fragment works as expected :

          (inf := open(file)) | stop("Can't open ",file)
          while line := read(inf) do
            if find(target,line) then break
          close(inf)
          return line

But with processes something goes wrong

          (inf := open(cmd,"pr") | stop("Can't run ",cmd)
          while line := read(inf) do
            if find(target,line) then break
          close(inf)
          return line

The close(inf) doesn't work here. The process stays open. Shouldn't it just
be killed? Eventually ones process quota is reached and the open fails if
the fragment is in a loop. Is this fixed in Icon 8? I think the unix versions
work properly (do they?).

          (inf := open(cmd,"pr") | stop("Can't run ",cmd)
          while line := read(inf) do
            if find(target,line) then temp := line
          close(inf)
          return temp

is my current work-around. But if it generates thousands of lines of output,
and I'm only interested in the first 10, it's rather wasteful.

Thanx,

Chris Tenaglia (System Manager)
Medical College of Wisconsin
8701 W. Watertown Plank Rd.
Milwaukee, WI 53226
(414)257-8765
tenaglia@mis.mcw.edu