/* user gives a target datasource with .shp and it does not exist, */
/* the shapefile driver will try to create a file, but this is not */
/* appropriate because here we have several layers, so create */
/* a directory instead. */
/* -------------------------------------------------------------------- */
if (poDriver.GetName().equalsIgnoreCase("ESRI Shapefile") &&
pszSQLStatement == null &&
(papszLayers.size() > 1 ||
(papszLayers.size() == 0 && poDS.GetLayerCount() > 1)) &&
pszNewLayerName == null &&
(pszDestDataSource.endsWith(".shp") || pszDestDataSource.endsWith(".SHP")))