Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ucla-cs!zen!ucbvax!EQL.Caltech.EDU!rankin From: rankin@EQL.Caltech.EDU (Pat Rankin) Newsgroups: comp.os.vms Subject: re: Command input from a file continued, and maybe a bug in VMS Message-ID: <870807140223.01g@EQL.Caltech.Edu> Date: Fri, 7-Aug-87 17:03:42 EDT Article-I.D.: EQL.870807140223.01g Posted: Fri Aug 7 17:03:42 1987 Date-Received: Sun, 9-Aug-87 13:24:52 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 27 < attempting to redefine SYS$INPUT inside a program which uses LIB$GET_INPUT > > All variations of the program (like read many lines instead of one, check > for EOFs and such, which i ommited here for the sake of brevity) seem > completely consistent: what counts for LIB$INPUT is not the translation of > SYS$INPUT at the time you call it, but AT THE TIME THE PROGRAM WAS INVOKED. > If SYS$INPUT points to the terminal at the beginning of the program, all > the LIB$SET_LOGICALS can't change the mind of LIB$GET_INPUT. > > The only question it: why is this so ? What use is LIB$SET_LOGICAL in this > case ? Is this a bug ? Should i SPR it ? Am i stupid ? Is there something > tricky (maybe using the right logical name table) i overlooked ? The logical name is used by RMS the first time (and only the first time) that the routine is called (not at image activation time). I haven't looked into LIB$GET_INPUT, but I have disassembled LIB$PUT_OUTPUT and I can tell you that it works in the following manner: -- the first time it is called, it uses $CREATE and $CONNECT to open a file called "SYS$OUTPUT" (a logical name referencing something). It saves the RMS ISI (Internal Stream Identifier, which is essentially a pointer to the open file). It then uses $PUT to write to the file. -- on subsequent calls, it retreives the ISI, builds a temporary RAB structure, and issues a $PUT. Undoubtedly LIB$GET_INPUT functions similarly. This should explain your problem, but it also illustrates that LIB$GET_INPUT cannot do the job you want to make it do. Pat Rankin