Delete all files that were marked as delete-on-exit. This recursively
deletes all files in the specified paths.
497219
protected void processDeleteOnExit() {
    synchronized (deleteOnExit) {
      for (Iterator<Path> iter = deleteOnExit.iterator(); iter.hasNext();) {
        Path path = iter.next();
        try {
          delete(path, true);
        }
        catch (IOException e) {
          LOG.info("Ignoring failure to deleteOnExit for path " + path);
        }
        iter.remove();
      }
    }
  }
182661
def _cleanup(path: str) -> None:
    """"""
    if os.path.isdir(path):
        shutil.rmtree(path)
298782
public void delete() {
    try {
      close();
      Files.delete(file.toPath());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
923130
function _deleteTmpFiles(files, done) {
        var keys;
        if (files) {
          keys = Object.keys(files);
        }
        if (keys && keys.length) {
          fs.unlink(files[keys[0]].path, function(err) {
                delete files[keys[0]];
                if (err) {
                  done(err);
                }
                else {
                  _deleteTmpFiles(files, done);
                }
            });
        }
        else {
          done(null);
        }
      }
636483
public function clear()
    {
        $this->paths = [];
        $this->names = [];
        $this->recursive = false;
        $this->file_only = false;
        $this->directory_only = false;
    }
1255378
public function clear() {
		foreach ($this->dirPath->getChildDirectories() as $nameDirPath) {
			$this->removeAll($nameDirPath->getName());	
		}
	}
738278
def _recursive_remove(fs, path):
    
    if not fs.is_link(path=path) and fs.is_dir(path=path):
        for child in fs.children(path=path):
            _recursive_remove(fs=fs, path=child)
        fs.remove_empty_directory(path=path)
    else:
        fs.remove_file(path=path)
804840
private boolean delete(String path, boolean recursive) throws IOException {
    IOException te = null;
    FileSystem hdfs = getFs();
    RetryPolicy retryPolicy = new CountingRetry(MAX_TRY);
    while (retryPolicy.attempt()) {
      try {
        return hdfs.delete(new Path(path), recursive);
      } catch (IOException e) {
        LOG.warn("Attempt count {} : {}", retryPolicy.getAttemptCount(), e.getMessage());
        te = e;
      }
    }
    throw te;
  }
1159900
public static void deleteDirectories(FileSystem fs, List<String> directoriesToDelete, boolean recursive, boolean moveToTrash) throws IOException {
    for (String directory : directoriesToDelete) {
      if (moveToTrash) {
        moveToTrash(fs, new Path(directory));
      } else {
        deletePath(fs, new Path(directory), recursive);
      }
    }
  }
280403
public void closeAllPaths() {
		_touch();
		if (m_bPolygon || isEmptyImpl())
			return;

		m_bPathStarted = false;

		for (int ipath = 0, npart = m_paths.size() - 1; ipath < npart; ipath++) {
			if (isClosedPath(ipath))
				continue;

			byte pf = m_pathFlags.read(ipath);
			m_pathFlags.write(ipath, (byte) (pf | PathFlags.enumClosed));
			// if (m_segmentFlags)
			// {
			// m_segmentFlags.write(m_pointCount - 1,
			// (byte)SegmentFlags.LineSeg));
			// m_segmentParamIndex.write(m_pointCount - 1, -1);
			// }
		}
	}
471453
def clean_py_files(path):
    

    for dirname, subdirlist, filelist in os.walk(path):

        for f in filelist:
            if f.endswith('py'):
                os.remove(os.path.join(dirname, f))
1330216
public void deleteAll() {
        if(trackedFiles.size() == 0) {
            return;
        }

        ArrayList<File> files = new ArrayList<File>(trackedFiles);
        Collections.sort(files, filePathComparator);

        for(File file : files) {
            if(file.exists()) {
                if(!file.delete()) {
                    throw new DataUtilException("Couldn't delete a tracked "
                            + (file.isFile()? "file":"directory" + ": ") + file.getAbsolutePath());
                }
            }
        }

        trackedFiles.clear();
    }
397352
public static void deletePathRecursively(String path) throws IOException {
    if (!exists(path)) {
      return;
    }
    Path root = Paths.get(path);
    Files.walkFileTree(root, new SimpleFileVisitor<Path>() {
      @Override
      public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
        Files.delete(file);
        return FileVisitResult.CONTINUE;
      }

      @Override
      public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
        if (e == null) {
          Files.delete(dir);
          return FileVisitResult.CONTINUE;
        } else {
          throw e;
        }
      }
    });
  }
444068
public boolean delete(Path path, boolean recursive) throws IOException {
      Path absolute = makeAbsolute(path);
      String srep = absolute.toUri().getPath();
      if (kfsImpl.isFile(srep))
        return kfsImpl.remove(srep) == 0;

      FileStatus[] dirEntries = listStatus(absolute);
      if ((!recursive) && (dirEntries != null) && 
            (dirEntries.length != 0)) {
        throw new IOException("Directory " + path.toString() + 
        " is not empty.");
      }
      if (dirEntries != null) {
        for (int i = 0; i < dirEntries.length; i++) {
          delete(new Path(absolute, dirEntries[i].getPath()), recursive);
        }
      }
      return kfsImpl.rmdir(srep) == 0;
    }
321667
private static void deleteOldAndEmptyFiles() {
            File dir = LOG_FILE_DIR;
            if (dir.exists()) {
                File[] files = dir.listFiles();

                for (File f : files) {
                    if (f.length() == 0 ||
                            f.lastModified() + MAXFILEAGE < System.currentTimeMillis()) {
                        f.delete();
                    }
                }
            }
        }
642647
def _delete(self, paths: Iterable[str]) -> None:
        
        for chunk in util.chunk(paths, self._MAX_DELETES_PER_REQUEST):
            keys = list([self._prefix + key for key in chunk])
            logger.info('Deleting %d objects (%s)', len(keys), ', '.join(keys))
            response = self._bucket.delete_objects(Delete={
                'Objects': [{'Key': key} for key in keys],
                'Quiet': True
            })
            logger.debug('Delete objects response: %s', response)
732465
public function deleteRecursively() {
		if ($this->exists()) {
			$entries = @\scandir($this->path);

			foreach ($entries as $entry) {
				if ($entry !== '.' && $entry !== '..') {
					$entryPath = $this->path . '/' . $entry;

					if (@\is_dir($entryPath)) {
						$this->deleteRecursively($entryPath);
					}
					else {
						@\unlink($entryPath);
					}
				}
			}

			@\rmdir($this->path);
		}
	}