Google
 

Trailing-Edge - PDP-10 Archives - tops20tools_v6_9-jan-86_dumper - tools/com/check.com
There are 3 other files named check.com in the archive. Click here to see a list.
$ save_Verify := 'F$Verify(0)
$!
$! CHECK  file  [return]	- Checks to see if file exists
$!				- if p2 is non-null success or failure is 
$!				  returned in CHECK_ERROR
$ if p1 .eqs. ""  Then  goto ERROR
$!
$ file := 'p1'
$ if f$locate("+",p1) .ne. f$length(p1)  then  goto END
$!
$!
$ file := 'f$search(p1,1)'		!in case of wild card
$ if file .eqs. ""  Then Goto ERROR
$!
$ Open/Read/Error=error temp 'file'	!try to open the file
$ Close temp
$!
$END:
$ Check_Error :== 0
$ save_Verify := 'F$Verify(Save_Verify)
$ Exit 			!return to caller
$!
$!
$ERROR:
$ Check_Error :== 1
$ WRITE sys$output "%Error, File ""''p1'"" not found."
$ save_Verify := 'F$Verify(Save_Verify)
$ If  p2 .eqs. ""  Then  STOP 	!all levels of command procedures
$ EXIT 				!give an error return.