Delete the work directory
487913
@Override
  public void abortTask(TaskAttemptContext context) throws IOException {
    try {
      if (workPath != null) { 
        context.progress();
        if (!outputFileSystem.delete(workPath, true)) {
          LOG.warn("Deleting output in " + workPath + " returns false");
        }
      }
    } catch (IOException ie) {
      LOG.warn("Error discarding output in " + workPath, ie);
      throw ie;
    }
  }
1365054
def action_delete(self, courseid, taskid, path):
        
        # normalize
        path = path.strip()
        if not path.startswith("/"):
            path = "/" + path

        wanted_path = self.verify_path(courseid, taskid, path)
        if wanted_path is None:
            return self.show_tab_file(courseid, taskid, _("Internal error"))

        # special case: cannot delete current directory of the task
        if "/" == wanted_path:
            return self.show_tab_file(courseid, taskid, _("Internal error"))

        try:
            self.task_factory.get_task_fs(courseid, taskid).delete(wanted_path)
            return self.show_tab_file(courseid, taskid)
        except:
            return self.show_tab_file(courseid, taskid, _("An error occurred while deleting the files"))
1288940
def cleanDir(self):
        '''  '''
        if os.path.isdir(self.outdir):
            baddies = ['tout.json','nout.json','hout.json']
            for file in baddies:
                filepath = os.path.join(self.outdir,file)
                if os.path.isfile(filepath):
                    os.remove(filepath)
1087594
def delete_directories(paths):
    
    for path in paths:
        if os.path.exists(path):
            shutil.rmtree(path)
876337
def cleanup_tmpdir(dirname):
    """"""
    if dirname is not None and os.path.exists(dirname):
        shutil.rmtree(dirname)
1034216
def remove_dirs(self, directory):
        

        LOG.info('Removing directory [ %s ]', directory)
        local_files = self._drectory_local_files(directory=directory)
        for file_name in local_files:
            try:
                os.remove(file_name['local_object'])
            except OSError as exp:
                LOG.error(str(exp))

        # Build a list of all local directories
        directories = sorted(
            [i for i, _, _ in os.walk(directory)],
            reverse=True
        )

        # Remove directories
        for directory_path in directories:
            try:
                os.removedirs(directory_path)
            except OSError as exp:
                if exp.errno != 2:
                    LOG.error(str(exp))
                pass
182661
def _cleanup(path: str) -> None:
    """"""
    if os.path.isdir(path):
        shutil.rmtree(path)
302378
def remove_directory(self, directory_name, *args, **kwargs):
		
		previous_path = self.session_path()
		try:
			self.session_path(directory_name)
			os.rmdir(self.full_path())
		finally:
			self.session_path(previous_path)
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)
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()
618474
def clear_temp(wdir, rmdir=True):
    """"""
    wdir = pathlib.Path(wdir)
    extensions = ["*.log", "*.dat", "*.txt"]

    for ext in extensions:
        for ff in wdir.glob(ext):
            ff.unlink()

    if rmdir:
        wdir.rmdir()
1065931
def remove(self):
        

        directory = self._directory()
        assert isinstance(directory, Directory)
        directory._fileDeleted(self)
56124
def remove_tmp_dir(self, directory):
        
        if(not directory.startswith('/tmp/')):
            print('Directory not in /tmp')
            exit()

        print('Deleting directory: ' + directory)

        shutil.rmtree(directory)
1012233
def clear(self):
        
        with self._conn:
            self._conn.execute('DELETE FROM results')
            self._conn.execute('DELETE FROM work_items')
56395
function cleanWww (projectRoot, locations) {
    var targetDir = path.relative(projectRoot, locations.www);
    events.emit('verbose', 'Cleaning ' + targetDir);

    // No source paths are specified, so mergeAndUpdateDir() will clear the target directory.
    FileUpdater.mergeAndUpdateDir(
        [], targetDir, { rootDir: projectRoot, all: true }, logFileOp);
}
548746
def delete(build_folder):
    
    if _meta_.del_build in ["on", "ON"] and os.path.exists(build_folder):
        shutil.rmtree(build_folder)
1684
def delete(self):
        """"""
        if self.isfile:
            os.remove(self.fn)
        elif self.isdir:
            shutil.rmtree(self.fn)