Delete a single downloaded local file.
962514
public void delete(URI src) {
    Path dst = null;
    try {
      dst = paths.get(src);
    } catch (ExecutionException e) {
      throw new RuntimeException(e);
    }
    try {
      Files.deleteIfExists(dst);
      paths.invalidate(src);
    } catch (IOException e) {
      String msg = String.format("Failed to delete %s -> %s", src, dst);
      LOG.error(msg, e);
    }
  }
1317539
def force_delete_file(file_path):
        '''  '''
        if os.path.isfile(file_path):
            try:
                os.remove(file_path)
                return file_path
            except:           
                return FileSystemUtils.add_unique_postfix(file_path)
        else:
            return file_path
319259
def drop(self):
        
        import os

        if self.path:
            if os.path.exists(self.path):
                os.remove(self.path)
        else:
            # Clear the in-memory data if there is no file path
            self._data = {}
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
229773
def remove_if_exists(filename):
    
    try:
        os.unlink(filename)
    except OSError as ex:
        if ex.errno != errno.ENOENT:
            raise
1339710
def _catalog_local_files_for_deletion(self):
        # type: (Downloader) -> None
        
        if not (self._spec.options.delete_extraneous_destination and
                self._spec.destination.is_dir):
            return
        dst = str(self._spec.destination.path)
        for file in blobxfer.util.scantree(dst):
            self._delete_after.add(pathlib.Path(file.path))
328433
function remove()
    {
        $path = $this->path();
        if ( file_exists( $path ) )
        {
            eZDir::recursiveDelete( $path );
        }
        $this->setInstalled( false );
    }
182661
def _cleanup(path: str) -> None:
    """"""
    if os.path.isdir(path):
        shutil.rmtree(path)
916961
def delete(self):
        """"""
        if self.filename == ':memory:':
            return True
        try:
            os.remove(self.filename)
            return True
        except OSError:
            return False
1100382
def _removeLru(self):
        
        (dataFile, handle) = self._cache.pop()
        handle.close()
        return dataFile
827479
function downloadManager_deleteDownloadedFiles(downloads) {
    downloads.forEach(function(download) {
      try {
        var file = getLocalFileFromNativePathOrUrl(download.target);
        file.remove(false);
      } catch (ex) {
      }
    });
  }
637343
def _delete_stale(self):
        
        for name, hash_ in self._stale_files.items():
            path = self.download_root.joinpath(name)
            if not path.exists():
                continue
            current_hash = self._path_hash(path)
            if current_hash == hash_:
                progress_logger.info('deleting: %s which is stale...', name)
                path.unlink()
                self._stale_deleted += 1
                while True:
                    path = path.parent
                    if path == self.download_root or list(path.iterdir()):
                        break
                    progress_logger.info('deleting: %s which is stale..', path.relative_to(self.download_root))
                    path.rmdir()
            else:
                progress_logger.error('Not deleting "%s" which is in the lock file but not the definition '
                                      'file, however appears to have been modified since it was downloaded. '
                                      'Please check and delete the file manually.', name)
                raise GrablibError('stale file modified')
1257907
def remove_file(self, name):
        """"""
        assert compat.is_native(name)
        self.check_write(name)
        # self.cur_dir_meta.remove(name)
        self.ftp.delete(name)
        self.remove_sync_info(name)
688595
def delete_object_from_file(file_name, save_key, file_location):
    
    file = __os.path.join(file_location, file_name)
    shelve_store = __shelve.open(file)
    del shelve_store[save_key]
    shelve_store.close()
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());
                    }
                }
            }
        }
    }
902096
def remove(self):
        """"""
        if self.exists() or self.islink():
            self.fs.unlink(self.get_internal_path())
            return 1
        return None
147124
def delete(filething):
    

    t = OggTheora(filething)
    filething.fileobj.seek(0)
    t.delete(filething)