        subroutine rasfile(ifile,name)
	include 'Online.cmm'
	integer system
        character*40 name
        character*50 fname
        character*80 dname,wname
        character*80 gname
        character*80 string
        dname='/project/atlas/BOL/RASRES/'//name
        wname='/project/atlas/BOL/RASRES/'//'rasmoni'
        fname='get '//name
        gname=fname//' rasmoni'
        open(29,file='getras.exe')
        write(29,*)'open bilbo.nikhef.nl'
          write(29,*)'user mdtoper BOLroom'
        write(29,*)'cd /project/mdt/Data/Rasnik/Daily'
        write(29,*)'lcd /project/atlas/BOL/RASRES'
        write(29,*)gname
        close(29)
C irasloc=-1 go for rasmoni
        if (irasloc.eq.-1) then
          open(ifile,file=wname,STATUS='OLD',ERR=199)
          read(ifile,'(a)',ERR=199,END=199)string
          rewind(ifile)
          print *,'RasRes file available '
          goto 200
        endif
C ftp file always on irasloc flag
        if (irasloc.eq.1) then
          open(ifile,file=dname,STATUS='OLD',ERR=199)
	  read(ifile,'(a)',ERR=199,END=199)string
          rewind(ifile)
          print *,'RasRes file available '
          goto 200
	endif
 99	continue
C if not there ftp file
	close(ifile)
	print *,'RasRes file not there yet '
        istat = system
     +    ('rm /project/atlas/BOL/RASRES/rasmoni')
        istat = system ('ftp -n < getras.exe')
        istat = system
     +    ('chmod g+w /project/atlas/BOL/RASRES/rasmoni')
        print *, 'ftp ended with status ', istat
	open(ifile,file=wname)
	read(ifile,'(a)',ERR=199,END=199)string
        rewind(ifile)
        print *,'RasRes file available now'
        goto 200
C if not exist give message
 199	print *,' RasRes file does not exist ',dname
	stop
 200	continue
        end


