Remove the block from a file.
540766
boolean removeBlock(String path, INodeFileUnderConstruction fileNode,
                      Block block) throws IOException {
    waitForReady();

    writeLock();
    try {
      // modify file-> block and blocksMap
      fileNode.removeBlock(block);
      getFSNamesystem().blocksMap.removeBlock(block);
      // Remove the block from corruptReplicasMap
      getFSNamesystem().corruptReplicas.removeFromCorruptReplicasMap(block);

      // write modified block locations to log
      fsImage.getEditLog().logOpenFile(path, fileNode);
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug("DIR* FSDirectory.removeBlock: "
                                      +path+" with "+block
                                      +" block is removed from the file system");
      }
    } finally {
      writeUnlock();
    }
    return true;
  }
682479
def remove(self):
        """"""
        num, sp, newfile = 0, "", []
        if os.path.isfile(self.filename):
            with open(self.filename, "r") as r:
                oldfile = r.read().splitlines()
                for line in oldfile:
                    if self.number:
                        num += 1
                        sp = ": "
                    if self.case_ins:
                        line = line.lower()
                    if self.ignore_blank and not line:
                        newfile.append(line)
                    elif line not in newfile:
                        newfile.append(line)
                    else:
                        if (self.args[0] in self.options[4:5] or
                                self.args[0] in self.options[6:7]):
                            if num == 0:
                                num = str()
                            print("{0}{1}{2}".format(num, sp, line))
            if self.args[0] not in self.options[6:7]:
                with open(self.filename, "w") as w:
                    for line in newfile:
                        w.write(line + "\n")
        else:
            self.not_access()
73191
def _reset(self):
        

        self._filename = None
        self._block_map = {}
        self._ast = []
        self._ast.append(None)  # header
        self._ast.append([])    # options list
        self._ast.append([])
1030121
def removeFileSafely(filename,clobber=True):
    
    if filename is not None and filename.strip() != '':
        if os.path.exists(filename) and clobber: os.remove(filename)
527768
def remove(image):
    """"""
    path = os.path.join(IMG_DIR, image)
    if os.path.isfile(path):
        os.remove(path)
1145317
void releaseBlock(BlockId blockId) throws IOException {
        synchronized (m_accessLock) {
            if (! m_blockPathMap.containsKey(blockId)) {
                throw new IllegalArgumentException("Request to release block that is not stored: " + blockId);
            }

            Path blockPath = m_blockPathMap.get(blockId);
            Files.delete(blockPath);
            m_blockPathMap.remove(blockId);
        }
    }
1033619
def delete(self, filething=None):
        """"""

        fileobj = filething.fileobj
        data = _APEv2Data(fileobj)
        if data.start is not None and data.size is not None:
            delete_bytes(fileobj, data.end - data.start, data.start)
        self.clear()
931146
public void removeEmptyBlocks() {
        Block curr = blocklistHead;
        Block prev = null;
        int effId = 0;
        while (curr != null) {
            if (!curr.isEmpty()) {
                curr.id = effId++;
                if (prev != null) {
                    prev.nextBlock = curr;
                } else {
                    blocklistHead = curr;
                }
                prev = curr;
            }
            curr = curr.nextBlock;
        }
        if (prev != null) {
            prev.nextBlock = null;
        } else {
            blocklistHead = null;
        }
        numBlocks = effId;
    }
1053834
def delete(cls, filename, offset=None):
        """"""
        with fileutil.opened(filename, "rb+") as file:
            if offset is None:
                file.seek(-128, 2)
            else:
                file.seek(offset)
            offset = file.tell()
            data = file.read(128)
            if data[:3] == b"TAG":
                fileutil.replace_chunk(file, offset, 128, b"", in_place=True)
438656
def remove_file(path, remove=os.remove, exists=os.path.exists):
    """"""
    try:
        remove(path)
    except OSError:
        if exists(path):
            raise
1240400
def erase(self):
        """"""
        with self._at_last_line():
            self.stream.write(self._term.clear_eol)
        self.stream.flush()
1078090
def file_remove(self, path, filename):
        
        if os.path.isfile(path + filename):
            os.remove(path + filename)
181659
def remove(self):
        
        from fs.errors import ResourceNotFoundError

        try:
            self._fs.remove(self.file_name)
        except ResourceNotFoundError:
            pass
794204
def clear_from(self, timestamp):
        """"""
        block_size = self.config.block_size
        offset, remainder = timestamp // block_size, timestamp % block_size
        if remainder:
            raise ValueError('Timestamp must be on a block boundary')
        self.driver.clear_from(offset, timestamp)
541728
boolean remove(BlockInfo blockInfo, RaidCodec codec) {
    if(queues.get(codec).remove(blockInfo)) {
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug(
                                      "BLOCK* NameSystem.RaidMissingBlocks.remove:"
                                      + blockInfo
                                      + " file "+ blockInfo.getINode()
                                      + " codec " + codec.id);
      }
      return true;
    }
    return false;
  }
916961
def delete(self):
        """"""
        if self.filename == ':memory:':
            return True
        try:
            os.remove(self.filename)
            return True
        except OSError:
            return False
908418
def remove(self, filename):
        
        output = self.shell('rm', filename)
        # any output means rm failed.
        return False if output else True