/*
Remove existing search results that match the given entry's path
@param {Array.<(File|Directory)>} entries
512879
function _removeSearchResultsForEntries(entries) {
            var fullPaths = [];
            entries.forEach(function (entry) {
                Object.keys(searchModel.results).forEach(function (fullPath) {
                    if (fullPath === entry.fullPath ||
                            (entry.isDirectory && fullPath.indexOf(entry.fullPath) === 0)) {
                        // node search : inform node that the file is removed
                        fullPaths.push(fullPath);
                        if (findOrReplaceInProgress) {
                            searchModel.removeResults(fullPath);
                            resultsChanged = true;
                        }
                    }
                });
            });
            // this should be called once with a large array instead of numerous calls with single items
            filesRemoved(fullPaths);
        }
943464
def remove_results(vcs, signature):
    
    results_directory = _get_results_directory(vcs, signature)
    if not os.path.exists(results_directory):
        raise ResultsNotFoundError
    shutil.rmtree(results_directory)
520163
protected boolean removeEldestEntry(Map.Entry<K, V> pEldest) {
        // NOTE: As removeLRU() may remove more than one entry, this is better
        // than simply removing the eldest entry.
        if (size() >= maxSize) {
            removeLRU();
        }
        return false;
    }
792896
function(paths, callback){
        //Remove original.
        var p = new _(paths.root + '/.gna');
        var path = p.toString();

        //Remove folers.
        fs.exists(path, function(exists){
            //delete when exists.
            if (exists) {
                //console.log("yeah about to delete main folder: ", p.toString());
                //Delete ans die here..
                p.rm(function(err, path){
                    //console.log("receives ", err, path);
                    if (err) {
                        //logger.error('gina', 'UTILS:CONFIG:ERR:8', err, __stack);
                        console.error(err.stack||err.message);
                        callback(err)
                    } else {
                        //logger.info('gina', 'UTILS:CONFIG:INFO:1', path +': deleted with success !');
                        console.info( path +': deleted with success !');
                        callback(false)
                    }
                })
            }
        })
    }
972459
function search_dir(file) {
		var matches = [];
		foreach(_dirs).do(function(dir) {
			if(path.existsSync(dir+"/"+file)) matches.push(dir);
		});
		if(matches.length != 0) return matches.shift();
	}
889530
public static function removeDirectories($directories = null)
	{
		if (is_null($directories))
		{
			static::$directories = array();
		}
		else
		{
			static::$directories = array_diff(static::$directories, (array) $directories);
		}
	}
571396
function omitFromArray(array, paths) {
  let indicesToRemove = [];

  const newCollection = reduce(
    (deeplyNestedOmittedCollection, path) => {
      if (path.length > 1) {
        return omitNested(path, deeplyNestedOmittedCollection, true);
      }

      indicesToRemove = [...indicesToRemove, ...path[0]];

      return deeplyNestedOmittedCollection;
    },
    array,
    paths
  );

  return removeIndicesFromArray(indicesToRemove, newCollection);
}
857075
function _removeDeletedFileFromMRU(e, fullPath) {
        var index,
            compare = function (record) {
                return (record.file.fullPath === fullPath);
            };

        // find and remove all instances
        do {
            index = _.findIndex(_mruList, compare);
            if (index !== -1) {
                _mruList.splice(index, 1);
            }
        } while (index !== -1);
    }
914179
function onSearchEnd(result) {
    if ((! pendingRangeRetrievals) && (pendingReferrals.length <= 0)) {
      client.unbind();
      log.info('Active directory search (%s) for "%s" returned %d entries.',
               baseDN, truncateLogOutput(opts.filter),
               (results || []).length);
      if (callback) callback(null, results);
    }
  }
63498
function cleanDir( path ) {
    var files = FS.readdirSync( path );
    try {
        files.forEach( function ( file ) {
            var fullpath = Path.join( path, file );
            if ( !FS.existsSync( fullpath ) ) return;
            var stat = FS.statSync( fullpath );
            try {
                if ( stat.isDirectory() ) PathUtils.rmdir( fullpath );
                else FS.unlinkSync( fullpath );
            } catch ( ex ) {
                console.error( "Unable to delete `" + fullpath + "`!" );
                console.error( ex );
            }
        } );
    } catch ( ex ) {
        fatal( "Fatal error in function `files`!\n" + JSON.stringify( ex, null, '  ' ) );
    }
}
1024047
def remove_files(self, *filenames):
        """"""
        filenames = list_strings(filenames)

        for dirpath, dirnames, fnames in os.walk(self.workdir):
            for fname in fnames:
                if fname in filenames:
                    filepath = os.path.join(dirpath, fname)
                    os.remove(filepath)
1087594
def delete_directories(paths):
    
    for path in paths:
        if os.path.exists(path):
            shutil.rmtree(path)
238167
private void removeEsDirectoryRecursively(final String path) throws Exception {
        logger.debug("Delete folder [{}]", path);
        Collection<String> listFile = getFileDirectory(path);

        for (String esfile : listFile) {
            esDelete(fsSettings.getElasticsearch().getIndex(), SignTool.sign(path.concat(File.separator).concat(esfile)));
        }

        Collection<String> listFolder = getFolderDirectory(path);
        for (String esfolder : listFolder) {
            removeEsDirectoryRecursively(esfolder);
        }

        esDelete(fsSettings.getElasticsearch().getIndexFolder(), SignTool.sign(path));
    }
788243
def remove_entry(data, entry):
    '''
    
    '''
    file_field = entry['fields'].get('file')
    if file_field:
        try:
            os.remove(file_field)
        except IOError:
            click.echo('This entry\'s file was missing')

    data.remove(entry)
879493
function(entries) {
        for ( var assetKey in entries ) {
            if ( entries.hasOwnProperty(assetKey) === false ) { continue; }
            entry = entries[assetKey];
            if ( entry.content !== 'filters' ) { continue; }
            newAvailableLists[assetKey] = Object.assign({}, entry);
        }

        // Load set of currently selected filter lists.
        var listKeySet = new Set(µb.selectedFilterLists);
        for ( listKey in newAvailableLists ) {
            if ( newAvailableLists.hasOwnProperty(listKey) ) {
                newAvailableLists[listKey].off = !listKeySet.has(listKey);
            }
        }

        finalize();
        callback(newAvailableLists);
    }
21421
private void deleteNonShuffleFiles(String[] dirs) {
    FilenameFilter filter = new FilenameFilter() {
      @Override
      public boolean accept(File dir, String name) {
        // Don't delete shuffle data or shuffle index files.
        return !name.endsWith(".index") && !name.endsWith(".data");
      }
    };

    for (String localDir : dirs) {
      try {
        JavaUtils.deleteRecursively(new File(localDir), filter);
        logger.debug("Successfully cleaned up non-shuffle files in directory: {}", localDir);
      } catch (Exception e) {
        logger.error("Failed to delete non-shuffle files in directory: " + localDir, e);
      }
    }
  }
1333097
def clear_dir(path):
    """"""
    for f in os.listdir(path):
        f_path = os.path.join(path, f)
        if os.path.isfile(f_path) or os.path.islink(f_path):
            os.unlink(f_path)