;+
;
;  FUNCTION UVSPDEVCK, FILE=FILE, [COMMENT=COMMENT, DISK=DISK]
;    check all devices in list and return the first one that contains FILE
;
;  KEYWORDS:
;	FILE : string name of the file to be found
;	COMMENT : is the widget ID of a text widget, where status messages
;		  will appear
;  	DISK : optionally may insert a disk(s) in front of hard code search path
;  OUTPUT : 
;	OPDEV : string name of the device with file found on it (if any)
;		if an error occurs the string "any device with" is returned
;	ERROR : 0 if file was found on any device
;		1 if file was not found on any device 
;
;-

function uvspdevck, file=file, comment=comment, error=error, disk=disk

 node = '15882'        	; node number for SDAC::

 if !version.os eq 'vms' then delim = '' else delim = '/'

 dataplace = getenv('UVSP_DATA')
 if dataplace eq '' then delim = ''

;95/3/6  device = ([dataplace+delim, node+'::dua0:[uvsp]', $
;		   node+'::dua1:[uvsp]', node+'::dub0:[uvsp]', $
;		   node+'::dub1:[uvsp]', node+'::duc0:[uvsp]', $
;		   node+'::duc1:[uvsp]', node+'::uvsp$data:'])

 device = ([dataplace+delim,node+'uvsp_data:'])

 if n_elements(disk) ne 0 then device = [disk, device]	

 maxdev = n_elements(device)-1   &   i = 0
 
 ; check each device listed, is desired file there
 repeat  begin                   ; look on newmax
    if n_elements(comment) ne 0 then widget_control, comment,  $
		set_value='Checking for file on '+ device(i), /append
    opdev = device(i)  &   i = i + 1

    find = findfile(opdev + file, count=count)
 endrep until count gt 0 or i gt maxdev

if count ne 0 then error = 0 $
else begin 
        error = 1
	opdev = 'any device with'  
	if n_elements(comment) ne 0 then widget_control, comment,  $
			set_value='Error finding ' +opdev+ ' '+ file , /append
endelse

return, opdev
end
