function [UnZippedFileName] = ConvertFiles(path,file)


global temp_path;

filename = file.name;

if(strcmp(filename(end-2:end),'.gz'))  %It's a zipped file.
  UnZippedFileName = filename(1:end-3);
else
  UnZippedFileName = filename;
end

UnZippedFile = dir([temp_path UnZippedFileName]);

if(isempty(UnZippedFile) || (UnZippedFile.datenum < file.datenum))
  cmd = ['cp ' path filename ' ' temp_path filename];
  unix(cmd);

  if(strcmp(filename(end-2:end),'.gz'))  %It's a zipped file.
   cmd = ['gunzip -f ' temp_path filename];
   unix(cmd);
  end
end


end

