Delete all files created by this index, invalidating `self`. Use with care.
506319
def terminate(self):
        """"""
        try:
            self.id2sims.terminate()
        except:
            pass
        import glob
        for fname in glob.glob(self.fname + '*'):
            try:
                os.remove(fname)
                logger.info("deleted %s" % fname)
            except Exception, e:
                logger.warning("failed to delete %s: %s" % (fname, e))
        for val in self.__dict__.keys():
            try:
                delattr(self, val)
            except:
                pass
696145
protected function deleteFiles()
    {
        $this->storage->delete($this->path);

        if ($this->type == 'image') {
            $this->storage->delete($this->thumbnails->toArray());
        }
    }
1205086
public function deleteAll()
    {
        foreach (scandir($this->directory) as $file) {
            if (!in_array($file, ['.', '..', 'keep'])) {
                unlink($this->directory . '/' . $file);
            }
        }
    }
1012082
public void delete() {
		for(int i = 1; i < m_nextNo; i++) {
			new File(m_fileName + "_" + i).delete();
		}
		m_nextNo = 1;
	}
635252
def cleanup(self):
        """"""
        for path in self.paths:
            if isinstance(path, tuple):
                os.close(path[0])
                os.unlink(path[1])
            else:
                shutil.rmtree(path)
        self.paths = []
534530
def delete_all(self):
        ''''''
        def delete_action_gen():
            scanner = scan(self.es,
                           index=self.index_name,
                           query={'query': {'match_all':{}}})
            for v in scanner:
                yield { '_op_type': 'delete',
                        '_index': self.index_name,
                        '_type': v['_type'],
                        '_id': v['_id'],
                      }
        bulk(self.es, delete_action_gen())
1065931
def remove(self):
        

        directory = self._directory()
        assert isinstance(directory, Directory)
        directory._fileDeleted(self)
964027
def remove(self, pattern):
        """"""
        assert isinstance(pattern, Pattern)
        self.patterns.remove(pattern)
        self._all_files = None
594196
def delete_all_but_self(self):
        
        prefix = self.settings.alias
        name = self.settings.index

        if prefix == name:
            Log.note("{{index_name}} will not be deleted",  index_name= prefix)
        for a in self.cluster.get_aliases():
            # MATCH <prefix>YYMMDD_HHMMSS FORMAT
            if re.match(re.escape(prefix) + "\\d{8}_\\d{6}", a.index) and a.index != name:
                self.cluster.delete_index(a.index)
394104
def cleanup(self):
        """"""
        t = time.time()
        for noncefile in glob(self.path + '/*.nonce'):
            if os.path.getmtime(noncefile) + self.expiration > t:
                os.unlink(noncefile)
1134580
def delete(self, raise_exc=True, headers=None, files=None):
        ''''''

        return self._request(DELETE, None, raise_exc, headers, files)
94760
def clear(self):
        
        while len(self._extensions):
            key = sorted(list(self._extensions.keys()))[0]
            self.remove(key)
328618
public void clean() {
        final Path bPath = FileSystems.getDefault().getPath(basePath);
        for (int i = 0; i < 3; i++) {
            try {
                final CleanUpFileVisitor visitor = new CleanUpFileVisitor();
                Files.walkFileTree(bPath, visitor);
                if (!visitor.hasErrors()) {
                    print("Deleted " + basePath);
                    return;
                } else if (useLogger && logger.isDebugEnabled()) {
                    for (final Throwable t : visitor.getErrors()) {
                        logger.debug("Could not delete files/directories.", t);
                    }
                }
            } catch (final Exception e) {
                print(e.getMessage() + " Retring to delete it.");
                try {
                    Thread.sleep(1000);
                } catch (final InterruptedException ignore) {
                    // ignore
                }
            }
        }
        print("Failed to delete " + basePath + " in this process.");
    }
434374
def cleanup(self):
        
        empty_keys = [k for k, v in self.items() if not v]

        for k in empty_keys:
            del self[k]
689938
def delete_files(paths):
    
    for path in paths:
        if os.path.exists(path):
            os.remove(path)
458465
def delete(self):
        

        directory = self._directory()
        assert isinstance(directory, Directory)

        realPath = self.realPath
        assert (os.path.exists(realPath))
        os.remove(realPath)

        directory._fileDeleted(self)
1114957
public function delete() : void
    {
        $files = $this->getFiles();
        foreach($files as $file) {
            $file->delete();
        }
        rmdir($this->path);
    }