[comp.lang.icon] Anyone want to be adventurous with VMS and C ?

tenaglia@mis.mcw.edu (Chris Tenaglia - 257-8765) (06/07/90)

I've discovered a small bug in Icon Version 8 under VAX/VMS 5.2. I like
mixing VMS and icon (to imitate pipes that are natural under unix. For
example.

###########################################################################
#                                                                         #
# resp.icn          5/29/90          by tenaglia                          #
#                                                                         #
# used in determining what slow response time is                          #
#                                                                         #
###########################################################################
procedure main()
  out := open("bench.log","w")
  repeat
    {
    bucket := []
    now := edit(&clock,"##$##$##")
    (test:= open("@RESP.COM","pr")) | stop("broken pipe")      # 1
    (log := open("RESP.LOG","w"))   | stop("what's with resp.log?")
    while put(bucket,read(test))
    close(test) | stop("Can't close process")                  # 2
    every write(log,!bucket) ; close(log)
    fin := edit(&clock,"##$##$##")
    write(out,&dateline," --> ",fin - now)
    system("wait 00:01:00")
    }
  end

########################################################################
#                                                                      #
# EXAMPLES :  edit("12/03/89","##$##$##") returns 120389               #
#             edit("120389","##/##/19##") returns 12/03/1989           #
#             edit("12/03/1989","##$")    returns 12                   #
#                                                                      #
########################################################################
procedure edit(var,mask)       
  text := ""
  var ? {
    every chr := !mask do {
      case chr of {
        "#" : text ||:= move(1)
        "$" : move(1)
        default : text ||:= chr
        }
      }
    }
  return text
end

In #1 I open a process for read. Later I read lines out of it. Finally in #2
I close the process to make it go away. It does, but not quite. After it loops
the number of times that equals the PRCLM on my account, it dies. Even if SHOW
SYSTEM shows no such processes.

Another similar and related problem is that if I would try to close the process
before reading all the lines. The close() is successful but the processes are
left hanging out there.

My question is, is there any VMS/C guru out there in Iconland who might have a
patch? I don't have C on our systems. I do have UUDECODE, in case you'd want to
mail the whole executable. Which exectable? ICONX.EXE. I browsed over the code
briefly. The close is accomplished by FSYS.C in [ICON.SRC.ICONX] around lines
43 to 54. Thanks in advance. (But I think most users are unix people).

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