Closes the file if the file was opened by :class:`File`,
        if not, this does nothing.

        Parameters
        ----------
        force: bool
            If set to :class:`True`, force close every file.
349145
def close(self, force=False) -> None:
        
        self.fp.close = self._close
        if self._manual_opened or force:
            self.fp.close()
977713
def close(self):
        
        # Check if any of the files have already been closed
        shp_open = self.shp and not (hasattr(self.shp, 'closed') and self.shp.closed)
        shx_open = self.shx and not (hasattr(self.shx, 'closed') and self.shx.closed)
        dbf_open = self.dbf and not (hasattr(self.dbf, 'closed') and self.dbf.closed)
            
        # Balance if already not balanced
        if self.shp and shp_open and self.dbf and dbf_open:
            if self.autoBalance:
                self.balance()
            if self.recNum != self.shpNum:
                raise ShapefileException("When saving both the dbf and shp file, "
                                         "the number of records (%s) must correspond "
                                         "with the number of shapes (%s)" % (self.recNum, self.shpNum))
        # Fill in the blank headers
        if self.shp and shp_open:
            self.__shapefileHeader(self.shp, headerType='shp')
        if self.shx and shx_open:
            self.__shapefileHeader(self.shx, headerType='shx')

        # Update the dbf header with final length etc
        if self.dbf and dbf_open:
            self.__dbfHeader()

        # Close files, if target is a filepath
        if self.target:
            for attribute in (self.shp, self.shx, self.dbf):
                if hasattr(attribute, 'close'):
                    try:
                        attribute.close()
                    except IOError:
                        pass
1253997
def close(self, file_des):
        
        file_handle = self.filesystem.get_open_file(file_des)
        file_handle.close()
173122
def delete_file(self, instance, sender, **kwargs):
        
        file_ = getattr(instance, self.attname)

        # If no other object of this type references the file, and it's not the
        # default value for future objects, delete it from the backend.
        query = Q(**{self.name: file_.name}) & ~Q(pk=instance.pk)
        qs = sender._default_manager.filter(query)

        if (file_ and file_.name != self.default and not qs):
            default.backend.delete(file_)
        elif file_:
            # Otherwise, just close the file, so it doesn't tie up resources.
            file_.close()
931513
def close(self):
        
        if self.closed:
            return

        if self.mode in "aw":
            self.fileobj.write(NUL * (BLOCKSIZE * 2))
            self.offset += (BLOCKSIZE * 2)
            # fill up the end with zero-blocks
            # (like option -b20 for tar does)
            blocks, remainder = divmod(self.offset, RECORDSIZE)
            if remainder > 0:
                self.fileobj.write(NUL * (RECORDSIZE - remainder))

        if not self._extfileobj:
            self.fileobj.close()
        self.closed = True
177870
def close
      begin
        @f.flush
        @f.flock(File::LOCK_UN)
        @f.close
      rescue IOError => e
        PEROBS.log.fatal "Cannot close stack file #{@file_name}: #{e.message}"
      end
    end
133630
def close(self):
    """"""
    self._report_file.close()
    # Make sure everything's closed.
    for files in self._output_files.values():
      for f in files.values():
        f.close()
692188
public synchronized void close() throws IOException {
    writable = false;
    if (map != null) {
      ByteArrayUtil.unmapByteBuffer(map);
      map = null;
    }
    if (lock != null) {
      lock.release();
      lock = null;
    }
    file.close();
  }
1231406
def close(self):
        """"""
        if not self.active:
            return

        self.active = False
        if self._file:
            self._file.close()
            self._sincedb_update_position(force_update=True)

        if self._current_event:
            event = '\n'.join(self._current_event)
            self._current_event.clear()
            self._callback_wrapper([event])
1199765
def close(self):
        
        if self.fd:
            os.close(self.fd)
            self.fd = None
915043
def _Close(self):
    """"""
    # pylint: disable=protected-access
    super(RawFile, self)._Close()

    for file_object in self._file_objects:
      file_object.close()

    self._file_objects = []
118643
public function closeFile()
    {
        if ($this->out != null) {
            $this->out->close();
            $this->out = null;
        }
    }
535201
def close (self):
        
        if self.child_fd == -1:
            return

        self.flush()
        os.close(self.child_fd)
        self.child_fd = -1
        self.closed = True
356424
def _Close(self):
    
    self._zip_file.close()
    self._zip_file = None

    self._file_object.close()
    self._file_object = None
1366722
public void release() {
        if (file != null) {
            file.setWritable(true);
        }
        if (savedFile != null) {
            savedFile.setWritable(true);
        }
    }
846221
def close(self):
        
        if self.file is None:
            return

        # Close the pickle file.
        self.file.close()
        self.file = None

        for f in self.mark_for_delete:
            error = [False]

            def register_error(*args):
                error[0] = True

            _shutil.rmtree(f, onerror = register_error)

            if error[0]:
                _atexit.register(_shutil.rmtree, f, ignore_errors=True)
1236709
def _Close(self):
    
    self._tar_file.close()
    self._tar_file = None

    self._file_object.close()
    self._file_object = None