Removes files that should not be packaged from the mirrored directory.
423571
protected function prepareMirrorDir()
    {
        $this->printTaskInfo(sprintf('Preparing directory %s.', $this->tmpDir));
        if (empty($this->ignoreFileNames)) {
            return;
        }
        $files = new Finder();
        $files->in($this->tmpDir);
        $files->ignoreDotFiles(false);
        $files->files();

        // Ignore files defined by the dev.
        foreach ($this->ignoreFileNames as $fileName) {
            $files->name($fileName);
        }
        $this->fs->remove($files);
    }
107726
function cleanupFsStorage(conf) {
    if (conf.cleanupStartup) {
        const storagePath = conf.storage,
              files = fs.readdirSync(storagePath);

        files.forEach((file) => {
            try {
                const filePath = utils.filePath(file, storagePath);
                fs.removeSync(filePath, {force: true});
            } catch (err) {}
        });
    }
}
1364451
def cleanup(self):
        

        self.log.debug("Cleaning up %s temporary directory" % self.tmp_dir)
        shutil.rmtree(self.tmp_dir, ignore_errors=True)
875660
def clean_except_files(self):
        """"""

        if self.is_finalized:
            self.warn("Can't clean; bundle is finalized")
            return False

        self.log('---- Cleaning ----')
        self.state = self.STATES.CLEANING

        self.commit()

        self.clean_sources()
        self.clean_tables()
        self.clean_partitions()
        self.clean_build()
        self.clean_ingested()
        self.clean_build_state()

        self.state = self.STATES.CLEANED

        self.commit()

        self.log('---- Done Cleaning ----')

        return True
462403
def exclude(self, pattern):
        """"""
        match = translate_pattern(pattern)
        return self._remove_files(match.match)
92199
protected function removeFiles()
    {
        $generator = $this->getFilenameOption();
        $pattern = $this->cacheDir . DIRECTORY_SEPARATOR . $generator('*');

        $objects = new GlobIterator($pattern);

        foreach ($objects as $object) {
            unlink($object);
        }
    }
66670
def remove(self, filename):
        """"""
        if self.list.pop(filename, None):
            self.modified_list = True
        if self.target.peer:  # otherwise `scan` command
            if self.target.is_local():
                remote_target = self.target.peer
                if remote_target.get_id() in self.dir["peer_sync"]:
                    rid = remote_target.get_id()
                    self.modified_sync = bool(
                        self.dir["peer_sync"][rid].pop(filename, None)
                    )
        return
1090803
def cleanup(self):
        """"""
        shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1]))
        if os.path.exists(self.name):
            raise IOError(17, "File exists: '{}'".format(self.name))
742767
def clear_dir(self):
        """"""
        for snapshot in output_utils.get_filenames(self.output_dir):
            if snapshot.endswith('.pkl'):
                os.remove(snapshot)
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)
15167
protected function cleanup()
    {
        if (is_dir($this->dir)) {
            // Recursively delete all files and folders.
            $files = new \RecursiveIteratorIterator(
                new \RecursiveDirectoryIterator($this->dir, \RecursiveDirectoryIterator::SKIP_DOTS),
                \RecursiveIteratorIterator::CHILD_FIRST
            );

            foreach ($files as $fileinfo) {
                if ($fileinfo->isDir()) {
                    rmdir($fileinfo->getRealPath());
                } else {
                    unlink($fileinfo->getRealPath());
                }
            }
            rmdir($this->dir);
            unset($this->git);
        }
    }
625691
def purge():
    """"""
    print("Purging the Blended files!")

    # Remove the templates folder
    templ_dir = os.path.join(cwd, "templates")
    if os.path.exists(templ_dir):
        shutil.rmtree(templ_dir)

    # Remove the content folder
    cont_dir = os.path.join(cwd, "content")
    if os.path.exists(cont_dir):
        shutil.rmtree(cont_dir)

    # Remove the  build folder
    build_dir = os.path.join(cwd, "build")
    if os.path.exists(build_dir):
        shutil.rmtree(build_dir)

    # Remove config.py
    config_file_dir = os.path.join(cwd, "config.py")
    if os.path.exists(config_file_dir):
        os.remove(config_file_dir)

    # Remove config.pyc
    config2_file_dir = os.path.join(cwd, "config.pyc")
    if os.path.exists(config2_file_dir):
        os.remove(config2_file_dir)

    # Remove config.py
    config3_file_dir = os.path.join(cwd, "config.py.oldbak")
    if os.path.exists(config3_file_dir):
        os.remove(config3_file_dir)
529593
function pruneLinks()
    {
        $this->files->ensureDirExists($this->sitesPath(), user());

        $this->files->removeBrokenLinksAt($this->sitesPath());
    }
828292
function removeDir(dirPath, cleanOnly) {
  var files;

  try {
    files = fs.readdirSync(dirPath);
  } catch(e) {
    return;
  }

  if (files.length > 0) {
    for (var i = 0; i < files.length; i++) {
      var filePath = path.join(dirPath, files[i]);
      if (fs.statSync(filePath).isFile())
        fs.unlinkSync(filePath);
      else
        rmDir(filePath);
    }
  }

  !cleanOnly && fs.rmdirSync(dirPath);
}
1204059
public function cleanUp()
    {
        $this->filesystem->remove($this->compressedArchivePath);
        $this->filesystem->remove($this->outputPath);
    }
220623
def clean_zipfile(self):
        ''''''
        if os.path.isfile(self.zip_file):
            os.remove(self.zip_file)
164318
def clean_dir(root):
    ''''''
    for x in root.walkdirs('.*', errors='ignore'):
        x.rmtree()
    for x in root.walkdirs('_*', errors='ignore'):
        x.rmtree()

    for x in root.walkfiles('.*', errors='ignore'):
        x.remove()
    for x in root.walkfiles('_*', errors='ignore'):
        x.remove()