FUNCTION extension,files ; ; This function returns a STRING array giving the extensions (i.e., ; the part after the '.') in the STRING array of file names passed ; in 'files'. ; ; Set up OS-dependent parameters @isitdos out=files FOR i=0,N_ELEMENTS(files)-1 DO BEGIN dotpos=STRPOS(files(i),'.') IF dotpos(0) NE -1 $ THEN out(i)=STRMID(files(i),dotpos(0)+1,STRLEN(files(i))-dotpos-1) $ ELSE out(i)='' ; missing extension ; The next two lines won't work, and aren't needed, under DOS, ; as presently coded. IF NOT dos THEN BEGIN gzpos=STRPOS(out(i),'.gz') IF (gzpos(0) NE -1) THEN out(i)=STRMID(out(i),0,gzpos(0)) ENDIF ENDFOR RETURN,out END