Deletes the downloaded zip & temporary directory.
503761
function (onComplete) {
            grunt.file.delete(options.tempDir, { force: true });

            fs.exists(options.downloadDestination, function (exists) {
                if (exists) {
                    fs.unlinkSync(options.downloadDestination);
                }

                if (onComplete) {
                    onComplete();
                }
            });
        }
431291
def delete(self):
        """"""
        if not self._sync:
            del self._buffer
        shutil.rmtree(self.cache_dir)
1363552
public static void purgeTempFiles(String tempdir) {
		if (tempdir == null) return;

		s_logger.info("Removing: "+tempdir);
		Path dlPath = Paths.get(tempdir).resolve("chemcomp");
		File[] chemCompOutFiles = finder(dlPath.toString(), "cif.gz");
		if (null != chemCompOutFiles) for (File f : chemCompOutFiles) f.delete();
		dlPath.toFile().delete();
	}
4408
def remove_temp_copy(self):
        
        if self.is_temp and self.root_dir is not None:
            shutil.rmtree(self.root_dir)
            self.root_dir = None
572860
def clean_tmpdir(path):
    """"""
    if os.path.exists(path) and \
       os.path.isdir(path):
        rmtree(path)
630541
def download_and_unpack(self, url, *paths, **kw):
        
        with self.temp_download(url, 'ds.zip', log=kw.pop('log', None)) as zipp:
            with TemporaryDirectory() as tmpdir:
                with zipfile.ZipFile(zipp.as_posix()) as zipf:
                    for path in paths:
                        zipf.extract(as_posix(path), path=tmpdir.as_posix())
                        copy(tmpdir.joinpath(path), self)
459237
public void cleanUp() {
    // Removing the entries from widgets.dat suffices. Opera will remove the other files.
    // These other files are:
    // widgets/xxx.oex
    // widgets/OEX_PATH_PREFIX/
    if (backupWidgetDat != null) {
      try {
        Files.move(backupWidgetDat, widgetsDat);
      } catch (IOException e) {
        throw new WebDriverException("Unable to restore widgets.dat");
      }
    } else {
      widgetsDat.delete();
    }
  }
639285
private function removeTempDirectory()
    {
        $tempDir       = \sys_get_temp_dir();
        $directoryPath = $tempDir . DIRECTORY_SEPARATOR . 'phpcq-author-validation';

        if (!\file_exists($directoryPath)) {
            return;
        }

        $directory = \opendir($directoryPath);

        while (($file = \readdir($directory)) !== false) {
            if (\in_array($file, ['.', '..'])) {
                continue;
            }

            \unlink($directoryPath . DIRECTORY_SEPARATOR . $file);
        }

        \rmdir($directoryPath);
    }
936685
def remove_uploaded_zip(self):
        

        # Remove the uploaded zip from S3, because it is now registered..
        self.zappa.remove_from_s3(self.zip_path, self.s3_bucket_name)

        # Finally, delete the local copy our zip package
        self.remove_local_zip()
1237819
def _cleanup_tempdir(tempdir):
    """"""
    try:
        shutil.rmtree(tempdir)
    except OSError as err:
        if err.errno != errno.ENOENT:
            raise
235895
def remove(self):
        """"""
        import shutil
        printtime('Removing large and/or temporary files', self.start)
        removefolder = list()
        for sample in self.metadata:
            # Use os.walk to iterate through all the files in the sample output directory
            for path, dirs, files in os.walk(sample.general.outputdirectory):
                for item in files:
                    # Use regex to find files to remove
                    if re.search(".fastq$", item) or re.search(".fastq.gz$", item) or re.search(".bam$", item) \
                            or re.search(".bt2$", item) or re.search(".tab$", item) or re.search("^before", item) \
                            or re.search("^baitedtargets", item) or re.search("_combined.csv$", item) \
                            or re.search("^scaffolds", item) or re.search(".fastg$", item) or re.search(".gfa$", item) \
                            or re.search(".bai$", item) or 'coregenome' in path or 'prophages' in path:
                        # Keep the baitedtargets.fa, core genome, and merged metagenome files
                        if item != 'baitedtargets.fa' and not re.search("coregenome", item) \
                                and not re.search("paired", item):
                            # Remove the unnecessary files
                            try:
                                os.remove(os.path.join(path, item))
                            except IOError:
                                pass
        # Clear out the folders
        for folder in removefolder:
            try:
                shutil.rmtree(folder)
            except (OSError, TypeError):
                pass
866689
static void fullyDelete(String dir, Configuration conf) throws IOException {
    if (dir != null) {
      Path tmp = new Path(dir);
      tmp.getFileSystem(conf).delete(tmp, true);
    }
  }
1357250
static void cleanup() {
        String tempFolder = getTempDir().getAbsolutePath();
        File dir = new File(tempFolder);

        File[] nativeLibFiles = dir.listFiles(new FilenameFilter() {
            private final String searchPattern = "secp256k1-";
            public boolean accept(File dir, String name) {
                return name.startsWith(searchPattern) && !name.endsWith(".lck");
            }
        });
        if(nativeLibFiles != null) {
            for(File nativeLibFile : nativeLibFiles) {
                File lckFile = new File(nativeLibFile.getAbsolutePath() + ".lck");
                if(!lckFile.exists()) {
                    try {
                        nativeLibFile.delete();
                    }
                    catch(SecurityException e) {
                        System.err.println("Failed to delete old native lib" + e.getMessage());
                    }
                }
            }
        }
    }
876337
def cleanup_tmpdir(dirname):
    """"""
    if dirname is not None and os.path.exists(dirname):
        shutil.rmtree(dirname)
1204059
public function cleanUp()
    {
        $this->filesystem->remove($this->compressedArchivePath);
        $this->filesystem->remove($this->outputPath);
    }
591110
def delete(self):
        """"""
        self.close()
        if self.does_file_exist():
            os.remove(self.path)
760810
def delete_files!(dir)
      File.delete(to_path) while setup_path(dir) && File.exist?(to_path)
    end