delete files list
503680
function revertInit(reinit, list, prefix, name, currentVersion) {
    exec('rm -Rf ./.versionFilesList.json', function(error, stdout, stderr) {
        if (error) sendProcessError(stdout, stderr);

        print('Deleted previous .versionFilesList.json', 'important', 'date');
        if (reinit) init(list, prefix, name, currentVersion);
    });
}
544099
private function removeOldFiles()
    {
        if ($handle = opendir($this->uploadDir)) {

            while (false !== ($file = readdir($handle))) {
                if (is_file($file)) {
                    if (filectime($this->uploadDir . $file) < (time() - $this->fileHandleTime)) {
                        unlink($this->uploadDir . $file);
                    }
                }
            }
        }
    }
1310493
public function remove_files() {
        $fs = get_file_storage();
        $files = $fs->get_external_files($this->id);
        foreach ($files as $storedfile) {
            $storedfile->delete();
        }
    }
1110548
function removeListFromWorkingSet(list) {
        DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()", true);
        CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list});
    }
1095772
def rm_files_in_dir(path):
    
    for f in os.listdir(path):
        try:
            os.remove(f)
        except PermissionError:
            os.chmod(f, 0o777)
            try:
                os.remove(f)
            except Exception:
                pass
    return
1016552
private void deleteBackups() {
        File[] storeDirList = ReadOnlyUtils.getVersionDirs(storeDir, 0L, getCurrentVersionId());
        if(storeDirList != null && storeDirList.length > (numBackups + 1)) {
            // delete ALL old directories asynchronously
            File[] extraBackups = ReadOnlyUtils.findKthVersionedDir(storeDirList,
                                                                    0,
                                                                    storeDirList.length
                                                                            - (numBackups + 1) - 1);
            if(extraBackups != null) {
                for(File backUpFile: extraBackups) {
                    deleteAsync(backUpFile);
                }
            }
        }
    }
34736
def clean():
    
    for dirpath, dirnames, filenames in os.walk('.'):
        for filename in filenames:
            if filename.endswith('.pyc') or filename.endswith('.pyo'):
                filepath = os.path.join(dirpath, filename)
                click.echo(f'Removing {filepath}')
                os.remove(filepath)
209425
def delete(self, file_path):
        """"""
        if os.sep in file_path:
            directory, file_name = file_path.rsplit(os.sep, 1)
            self.chdir(directory)
            return self.session.delete(file_name)

        else:
            return self.session.delete(file_path)
1236743
def _cleanup(self):
        """"""
        for filename in os.listdir(self._storage_dir):
            file_path = path.join(self._storage_dir, filename)
            file_stat = os.stat(file_path)
            evaluate = max(file_stat.st_ctime, file_stat.st_mtime)
            if evaluate + self._duration < time.time():
                LOGGER.debug('Removing stale file: %s', file_path)
                os.unlink(file_path)
799995
def remove_files_in_dir(dpath, fname_pattern_list='*', recursive=False,
                        verbose=VERBOSE, dryrun=False, ignore_errors=False):
    
    if isinstance(fname_pattern_list, six.string_types):
        fname_pattern_list = [fname_pattern_list]
    if verbose > 2:
        print('[util_path] Removing files:')
        print('  * from dpath = %r ' % dpath)
        print('  * with patterns = %r' % fname_pattern_list)
        print('  * recursive = %r' % recursive)
    num_removed, num_matched = (0, 0)
    if not exists(dpath):
        msg = ('!!! dir = %r does not exist!' % dpath)
        if verbose:
            print(msg)
        warnings.warn(msg, category=UserWarning)
    for root, dname_list, fname_list in os.walk(dpath):
        for fname_pattern in fname_pattern_list:
            for fname in fnmatch.filter(fname_list, fname_pattern):
                num_matched += 1
                num_removed += remove_file(join(root, fname),
                                           ignore_errors=ignore_errors,
                                           dryrun=dryrun,
                                           verbose=verbose > 5)
        if not recursive:
            break
    if verbose > 0:
        print('[util_path] ... Removed %d/%d files' % (num_removed, num_matched))
    return True
591110
def delete(self):
        """"""
        self.close()
        if self.does_file_exist():
            os.remove(self.path)
1025095
private function actionDelete()
    {
        $baseName = substr($this->path, 0, strrpos($this->path, '.'));
        $files = glob($baseName . '.*');
        if (!is_array($files))
        {
            $files = array();
        }
        $files2 = glob($baseName . '-*');
        if (!is_array($files2))
        {
            $files2 = array();
        }

        $files = array_merge($files, $files2);

        foreach ($files as $file)
        {
            @unlink($file);
        }
    }
1303172
def removeFile(inlist):
    

    if not isinstance(inlist, string_types):
    # We do have a list, so delete all filenames in list.
        # Treat like a list of full filenames
        _ldir = os.listdir('.')
        for f in inlist:
        # Now, check to see if there are wildcards which need to be expanded
            if f.find('*') >= 0 or f.find('?') >= 0:
                # We have a wild card specification
                regpatt = f.replace('?', '.?')
                regpatt = regpatt.replace('*', '.*')
                _reg = re.compile(regpatt)
                for file in _ldir:
                    if _reg.match(file):
                        _remove(file)
            else:
                # This is just a single filename
                _remove(f)
    else:
        # It must be a string then, so treat as a single filename
        _remove(inlist)
687313
public static void emptyAndDelete(File fileOrDir) {
		if (fileOrDir.isDirectory()) {
			File[] files = fileOrDir.listFiles();
			for (File file : files) {
				emptyAndDelete(file);
			}
		}
		fileOrDir.delete();
	}
279667
def delete_file(f):
    
    fp = f.get_fullpath()
    log.info("Deleting file %s", fp)
    os.remove(fp)
200602
def remove_files(self):
        """"""
        file_list = ["molecule.svg","lig.pdb","HIS.pdb","PHE.pdb","TRP.pdb","TYR.pdb","lig.mol","test.xtc"]
        for residue in self.topol_data.dict_of_plotted_res.keys():
            file_list.append(residue[1]+residue[2]+".svg")
        for f in file_list:
            if os.path.isfile(f)==True:
                os.remove(f)
599307
public static function removeOldFiles() {
		
		if (!is_dir(static::TEMP_FOLDER)) {
			return;
		}
		
		$app = Application::getInstance();
		$counter = 0;

		$files = Utilities::getDirectoryFilenames(static::TEMP_FOLDER);

		foreach ($files as $file) {

			$pathFile	= APPLICATION_PATH . '/' .static::TEMP_FOLDER . '/' . $file;
			$fileLife	= time() - filemtime($pathFile);
			$maxLife	= static::FILE_EXPIRE * 60;
			
			if ($fileLife > $maxLife) {
				$counter++;
				unlink($pathFile);
			}

		}
		
		if ($counter) {
			$app->logEvent($counter . ' files has been deleted from ' . static::TEMP_FOLDER);
		} else {
			$app->logEvent('No old files deleted from ' . static::TEMP_FOLDER);
		}
		
	}