PRO cloqlfil,year,month,day,qlunits ; This procedure closes all the quick-look files opened by ; iniqlfil.pro. After closing them, it looks for any ; previously-existing quick-look files from the given date, and ; concatenates them appropriately with the newly-closed files. It ; them sorts them (using the existing Unix tools), discarding any ; redundant lines, to produce time-ordered quick-look data files ; for the given date. @isitdos CD,qlroot FOR j=0,N_ELEMENTS(qlunits)-1 DO BEGIN qlu=qlunits(j) CLOSE,qlu FREE_LUN,qlu ENDFOR FOR ic=0,1 DO $ FOR ifilt=0,4 DO BEGIN tfn=STRING(ic,ifilt,FORMAT='("tmp",2I1,".ql")') fn=STRING(year MOD 100,month,day,ic,ifilt $ ,FORMAT='(3I2.2,2I1,".ql")') foundfn=FINDFILE(fn,COUNT=nfn) IF nfn GT 0 THEN BEGIN IF dos THEN BEGIN SPAWN,'copy '+fn+'+'+tfn+' tmpql' SPAWN,'sort < tmpql > '+fn ENDIF ELSE BEGIN SPAWN,'cat '+fn+' '+tfn+' >! tmpql' SPAWN,'sort -nu +0 -1 tmpql >! '+fn ENDELSE SPAWN,rmcmd+tfn ENDIF ELSE SPAWN,mvcmd+tfn+' '+fn ENDFOR ftmp=FINDFILE('tmpql') IF ftmp(0) NE '' THEN SPAWN,rmcmd+'tmpql' CD,root RETURN END