function unzip_dir(file_root,ii_ask)
%
% Unzips multiple files in current directory
%
% Call unzip_dir(file_root),
%
% where file_root may contain asterisks for wildcards (but do not include '*.zip');
%
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
if nargin<2, ii_ask=1; end
D=dir([file_root,'*.zip']); nfile=length(D);
for jfile=1:nfile,
    zip_file=D(jfile).name;
    disp(['Unzipping file ',zip_file,' of length ',int2str(D(jfile).bytes),' bytes ...']); ii_do=1;
    unzip_file=[zip_file(1:end-4)];
    if exist(unzip_file) & ii_ask,
        DZ=dir(unzip_file);
        ii_do=input(['Unzipped file ',unzip_file,' of length ',int2str(DZ(1).bytes), ...
                ' bytes already exists. Overwrite it? (0=no, 1=yes) ']);
    end
    if ii_do,
        unzip(D(jfile).name);
        DZ=dir(unzip_file); 
        disp(['Unzipped file name = ',DZ(1).name,'; size = ',int2str(DZ(1).bytes),' bytes']);
    end
end
