Public function that removes temporary tar archive files in a local directory
763953
def remove_tar_files(file_list):
    """"""
    for f in file_list:
        if file_exists(f) and f.endswith('.tar'):
            os.remove(f)
750563
def remove_files():
    
    logger.info("Removing local track files that were not downloaded...")
    files = [f for f in os.listdir('.') if os.path.isfile(f)]
    for f in files:
        if f not in fileToKeep:
            os.remove(f)
201882
def cleanup(self):
        ""
        log.info('Removing temp dir %s', self._tempdir.name)
        self._tempdir.cleanup()
885607
def cleanup(dest, tardir, counterfile):
    """"""
    thefiles = Queue()
    # dest directory files
    queue_files(dest, thefiles)
    # tar directory files
    queue_files(tardir, thefiles)
    while not thefiles.empty():
        d_file = thefiles.get()
        info("Deleting file: %s" % d_file)
        os.unlink(d_file)
    if os.path.exists(counterfile):
        info("Deleting the counter file %s" % counterfile)
        os.unlink(counterfile)
572860
def clean_tmpdir(path):
    """"""
    if os.path.exists(path) and \
       os.path.isdir(path):
        rmtree(path)
1252304
def Clean():
  """"""
  # Find all the compiled proto files and unlink them.
  for (root, _, files) in os.walk(ROOT):
    for filename in files:
      full_filename = os.path.join(root, filename)
      if full_filename.endswith("_pb2.py") or full_filename.endswith(
          "_pb2.pyc"):
        os.unlink(full_filename)
1018816
public static function cleanupNotRemovedFiles()
    {
        $timeOneWeekAgo = strtotime('-1 week');

        $files = _glob(self::getTmpPath() . '/*');
        if (empty($files)) {
            return;
        }

        foreach ($files as $file) {
            if (file_exists($file)) {
                $timeLastModified = filemtime($file);

                if ($timeLastModified !== false && $timeOneWeekAgo > $timeLastModified) {
                    unlink($file);
                }
            }
        }
    }
667391
def extract_tar(url, target_dir, additional_compression="", remove_common_prefix=False, overwrite=False):
    
    try:
        if not os.path.exists(target_dir):
            os.makedirs(target_dir)
        tf = tarfile.TarFile.open(fileobj=download_to_bytesio(url))
        if not os.path.exists(target_dir):
            os.makedirs(target_dir)
        common_prefix = os.path.commonprefix(tf.getnames())
        if not common_prefix.endswith('/'):
            common_prefix += "/"
        for tfile in tf.getmembers():
            if remove_common_prefix:
                tfile.name = tfile.name.replace(common_prefix, "", 1)
            if tfile.name != "":
                target_path = os.path.join(target_dir, tfile.name)
                if target_path != target_dir and os.path.exists(target_path):
                    if overwrite:
                        remove_path(target_path)
                    else:
                        continue
                tf.extract(tfile, target_dir)
    except OSError:
        e = sys.exc_info()[1]
        raise ExtractException(str(e))
    except IOError:
        e = sys.exc_info()[1]
        raise ExtractException(str(e))
1159552
def cleanup_temp_filesystem(self):
        
        logger.debug("Deleting compressed file extraction directory: " + self.tmp_dir)
        shutil.rmtree(self.tmp_dir, True)
1342550
def strip_files(args, parser):
    """"""
    stripper = tacl.Stripper(args.input, args.output)
    stripper.strip_files()
565738
function tarDir(dir) {
    var archiveName = path.basename(dir) +'.orig.tar.xz';
    var archivePath = path.join(path.dirname(dir), archiveName);

    return exec('tar cfJ '+ archivePath +' '+ dir);
}
39538
def clean(self):
        
        if not self._save_temp:
            if hasattr(self, '_written_files'):
                map(os.unlink, self._written_files)
            if getattr(self, '_remove_tempdir_on_clean', False):
                shutil.rmtree(self._tempdir)
107798
def tar_to_bigfile(self, fname, outfile):
        """"""
        fnames = []
        tmpdir = mkdtemp()
        
        # Extract files to temporary directory
        with tarfile.open(fname) as tar:
            tar.extractall(path=tmpdir)
        for root, _, files in os.walk(tmpdir):
            fnames += [os.path.join(root, fname) for fname in files]
        
        # Concatenate
        with open(outfile, "w") as out:
            for infile in fnames:
                for line in open(infile):
                    out.write(line)
                os.unlink(infile)
        
        # Remove temp dir
        shutil.rmtree(tmpdir)
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();
	}
97357
def extract_tar(tar_path, target_folder):
    
    with tarfile.open(tar_path, 'r') as archive:
        archive.extractall(target_folder)
695610
def clean():
    ''''''

    basedir = dirname(__file__)

    print(cyan('delete temp files and dirs for packaging'))
    local(flo(
        'rm -rf  '
        '{basedir}/.eggs/  '
        '{basedir}/fabsetup.egg-info/  '
        '{basedir}/dist  '
        '{basedir}/README  '
        '{basedir}/build/  '
    ))

    print(cyan('\ndelete temp files and dirs for editing'))
    local(flo(
        'rm -rf  '
        '{basedir}/.cache  '
        '{basedir}/.ropeproject  '
    ))

    print(cyan('\ndelete bytecode compiled versions of the python src'))
    # cf. http://stackoverflow.com/a/30659970
    local(flo('find  {basedir}/fabsetup  '
              'fabfile*  ') +
          '\( -name \*pyc -o -name \*.pyo -o -name __pycache__ '
          '-o -name \*.so -o -name \*.o -o -name \*.c \) '
          '-prune '
          '-exec rm -rf {} + || true')
419307
def untar_file(tarname, target_dir='.'):
    ''''''

    o = tarfile.open(tarname, 'r:gz')
    members = o.getmembers()
    for member in members:
        o.extract(member, target_dir)
    o.close()