pro get_tim_all, infil, day, time, rate, year=year, info=info, tables_dir=tables_dir, strec=strec, enrec=enrec
;
;
;The output vector is always the full length of the file, even if
;strec and enrec are specified (specifying those parameters just means
;that the file is only read for those parts)
;HISTORY:
;	Written Fall 1991 by M.Morrison
;	18_Aug-93 (MDM) - Removed "dir" keyword on TABLE_DUMP call
;
ff = findfile(infil)
if (ff(0) eq '') then begin
    print, 'File does not exist'
    return
end
;
;;if (not keyword_set(year)) then year = 91	;removed 25-Mar-92
;
start_time = systime(1)
;
get_lun, lun
openr, lun, infil, /block
f = fstat(lun)
nmf = long(f.size / 9216)
;
day = intarr(nmf)
time = lonarr(nmf)
rate = bytarr(nmf)
irec_table = -99
err = 0
irec = 0
if (keyword_set(strec)) then irec = strec
ist = irec
while (err ne 36) do begin
    rd_telem, infil, irec, rec1, err		;, /force
						;cannot force
    ;
    if (err ne 36) then begin
	ttim2ex, rec1, daytim, year
	ex2int, daytim, msod, ds79
	day(irec) = ds79
	time(irec) = msod
	rate(irec) = rec1(16+48, 15)

	if (keyword_set(tables_dir)) then begin	;check for SXT table dumps
            telemmode = decom(rec1, 'telemmode', 0)
            hard_reset = decom(rec1, 'u_hard_r', 0) 
	    del_rec = irec - irec_table	;check that not in the middle of a dump that is already received
            if ( (telemmode eq 2) and (irec ne 0) and (del_rec gt 4) and (not hard_reset) ) then begin
                table_dump, infil, irec+1, year=year   ;second record has what we want
		irec_table = irec
	    end
        end

    end
    ;
    irec = irec + 1
    if (keyword_set(enrec)) then if (irec gt enrec) then err=36		;abort out
end
ien = irec
;
end_time = systime(1)
if (keyword_set(info)) then begin
    dtim = end_time - start_time
    print, 'GET_TIM_ALL took ', dtim, ' seconds for ', (ien-ist), ' major frames'
    print, '    which is     ', dtim*1280/(ien-ist), ' seconds for 1280 major frames'
end
;
free_lun, lun
end
