%%s 0/0/0 %%d D 1.1 27-Mar-82 14:58:44 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 #-h- exist.r 716 asc 25-mar-82 09:32:11 v1.1 (sw-tools v1.1) #-h- main 402 asc 25-mar-82 09:31:59 v1.1 (sw-tools v1.1) define(WARNING,3) define(SUCCESS,1) define(XEQERROR,5) DRIVER(exist) integer getarg, exist character file(FILENAMESIZE) string usestr "usage: exist file" call query(usestr) if (getarg(1, file, FILENAMESIZE) == EOF) { call remark(usestr) call sys$exit(%val(WARNING)) } if (exist(file) == ERR) call sys$exit(%val(XEQERROR)) else call sys$exit(%val(SUCCESS)) end #-h- exist 168 asc 25-mar-82 09:32:00 v1.1 (sw-tools v1.1) integer function exist(file) character file(ARB) integer int integer open int = open(file, READ) if (int != ERR) call close(int) exist = int return end #-h- exist.fmt 458 asc 25-mar-82 09:32:12 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Exist (1) 29-Oct-80 check for the existence of a file .sy exist file .ds exist attempts to open the named file at READ access. If successful, it closes the file and returns the value of 1 in the DCL symbol $STATUS. Common uses are for system-wide login files for the invocation of your login.com file as in the following: .sp .nf $ exist:==$st_bin:exist $ exist login.com $ if $STATUS.eq.1 then @login .fi .fl .sa .di .au Joe Sventek .bu %%E 1