	PRO comp_sda, file, comp_flags, buf=buf, type_comp=type_comp, $
                            no_overwrt=no_overwrt
;	------------------------------------------------------------
;+							12-Oct-95
;      PURPOSE: Calls sav_sda w/index and data from rd_xda
;
;
;      PGS: Added type_comp                             10-Dec-97
;      PGS: Added test for wrong size of comp_flags     09-Jan-98
;      PGS: Added test for and forced overwrite of '_c' files to '_c' files.
;          (This is used by comp_sfr_arch.pro when making multiple 
;            compression passes of the same sfr file.) 
;-
;	------------------------------------------------------------
	ibuf = -1;		read all frames for now
;
	rd_xda, file, ibuf, index, data
;
;
        IF (n_elements(comp_flags) LT n_elements(index)) THEN STOP,'comp_flags has wrong dimensions.'
;
        IF (keyword_set(no_overwrt)) THEN BEGIN
	sav_sda, file+'_c', index, data, /use_index_size, compress=comp_flags, type_comp=type_comp
        ENDIF ELSE BEGIN
	sav_sda, file, index, data, /use_index_size, compress=comp_flags, type_comp=type_comp
        ENDELSE
;	
;
	return
	end
