close opened file

        :param force: force closing of externally opened file or buffer
492188
def close(self, force=False):
        
        if self.__write:
            self.write = self.__write_adhoc
            self.__write = False

        if not self._is_buffer or force:
            self._file.close()
1203263
def close(self, fd):
        
        try:
            fd = self.state.solver.eval_one(fd)
        except SimSolverError:
            l.error("Trying to close a symbolic file descriptor")
            return False

        if fd not in self.fd:
            l.info("Trying to close an unopened file descriptor")
            return False

        self.state.history.add_event('fs_close', fd=fd, close_idx=len(self.closed_fds))
        self.closed_fds.append((fd, self.fd[fd]))

        del self.fd[fd]
        return True
1130286
def force_delete(self):
        
        self._force_deleting = True

        self.delete()

        self._force_deleting = False
240299
def close(self):
        
        try:
            self.p.stdin.write(bytes("X\n","utf-8"))
            self.p.stdin.flush()
        except IOError:
            self.report("could not send exit command")
        self.p.wait() # wait until the process is closed
        try:
            os.remove(self.tmpfile) # clean up the temporary file
        except FileNotFoundError:
            pass
933234
private final void _close(boolean forceClosing)
        throws IOException
    {
        byte[] buf = mOutBuffer;
        if (buf != null) {
            mOutBuffer = null;
            if (mOutPtr > 0) {
                mOut.write(buf, 0, mOutPtr);
                mOutPtr = 0;
            }
            if (mConfig != null) {
                mConfig.freeFullBBuffer(buf);
            }
        }

        if (forceClosing) {
            mOut.close();
        }
        
        /* Let's 'flush' orphan surrogate, no matter what; but only
         * after cleanly closing everything else.
         */
        int code = mSurrogate;
        if (code > 0) {
            mSurrogate = 0;
            throwIllegal(code);
        }
    }
82108
private void closeInputFile() throws IOException
	{
		myLineReader.close();
		myBufferedReader.close();
		myStreamReader.close();
		myInputStream.close();
	}
902749
public void closeJARs(boolean force) {
        if (jarFiles.length > 0) {
                synchronized (jarFiles) {
                    if (force || (System.currentTimeMillis() 
                                  > (lastJarAccessed + 90000))) {
                        for (int i = 0; i < jarFiles.length; i++) {
                            try {
                                if (jarFiles[i] != null) {
                                    jarFiles[i].close();
                                    jarFiles[i] = null;
                                }
                            } catch (IOException e) {
                                if (log.isDebugEnabled()) {
                                    log.debug("Failed to close JAR", e);
                                }
                            }
                        }
                    }
                }
        }
    }
1355683
def closeEvent(self, event):
        

        self.__interrupt_search()
        super(SearchInFiles, self).closeEvent(event)
1253997
def close(self, file_des):
        
        file_handle = self.filesystem.get_open_file(file_des)
        file_handle.close()
1017693
def _Close(self):
    
    self._bde_volume.close()
    self._bde_volume = None

    self._file_object.close()
    self._file_object = None
1215624
def close(self):
    """"""
    self.acquire()
    try:
      self.flush()
      try:
        # Do not close the stream if it's sys.stderr|stdout. They may be
        # redirected or overridden to files, which should be managed by users
        # explicitly.
        if self.stream not in (sys.stderr, sys.stdout) and (
            not hasattr(self.stream, 'isatty') or not self.stream.isatty()):
          self.stream.close()
      except ValueError:
        # A ValueError is thrown if we try to run isatty() on a closed file.
        pass
      super(PythonHandler, self).close()
    finally:
      self.release()
601846
def Close(self):
    
    if not self._is_open:
      raise IOError('Not opened.')

    if not self._is_cached:
      close_file_system = True
    elif self._resolver_context.ReleaseFileSystem(self):
      self._is_cached = False
      close_file_system = True
    else:
      close_file_system = False

    if close_file_system:
      self._Close()
      self._is_open = False
      self._path_spec = None
1338024
def close(self):
        """"""

        # Return file prompt quiet to the original state
        if self.auto_file_prompt and self.prompt_quiet_changed is True:
            self.device.send_config_set(["no file prompt quiet"])
            self.prompt_quiet_changed = False
            self.prompt_quiet_configured = False
        self._netmiko_close()
86378
static public void close(FileObject fo){
		if (fo != null){
			try {
				fo.close();
			} catch (FileSystemException e) {
				log.debug("Exception when closing FileObject: " + fo.getName(), e);
			}
		}
	}
199439
def close_file(self, index=None, force=False):
        """"""
        current_index = self.get_stack_index()
        count = self.get_stack_count()

        if index is None:
            if count > 0:
                index = current_index
            else:
                self.find_widget.set_editor(None)
                return

        new_index = None
        if count > 1:
            if current_index == index:
                new_index = self._get_previous_file_index()
            else:
                new_index = current_index

        is_ok = force or self.save_if_changed(cancelable=True, index=index)
        if is_ok:
            finfo = self.data[index]
            self.threadmanager.close_threads(finfo)
            # Removing editor reference from outline explorer settings:
            if self.outlineexplorer is not None:
                self.outlineexplorer.remove_editor(finfo.editor.oe_proxy)

            filename = self.data[index].filename
            self.remove_from_data(index)
            finfo.editor.notify_close()

            # We pass self object ID as a QString, because otherwise it would
            # depend on the platform: long for 64bit, int for 32bit. Replacing
            # by long all the time is not working on some 32bit platforms
            # (see Issue 1094, Issue 1098)
            self.sig_close_file.emit(str(id(self)), filename)

            self.opened_files_list_changed.emit()
            self.update_code_analysis_actions.emit()
            self._refresh_outlineexplorer()
            self.refresh_file_dependent_actions.emit()
            self.update_plugin_title.emit()

            editor = self.get_current_editor()
            if editor:
                editor.setFocus()

            if new_index is not None:
                if index < new_index:
                    new_index -= 1
                self.set_stack_index(new_index)

            self.add_last_closed_file(finfo.filename)

        if self.get_stack_count() == 0 and self.create_new_file_if_empty:
            self.sig_new_file[()].emit()
            return False
        self.__modify_stack_title()
        return is_ok
277795
def close(self):
        '''
        

        '''

        if self.compressed_file is None:
            with self.path.open('rb+') as f:
                f.seek(0, 2)
                eof = f.tell()
                self._update_offset_value(f, self.gdr_head+36, 8, eof)
                if self.checksum:
                    f.write(self._md5_compute(f))
            return
# %%
        with self.path.open('rb+') as f:
            f.seek(0, 2)
            eof = f.tell()
            self._update_offset_value(f, self.gdr_head+36, 8, eof)

            with self.compressed_file.open('wb+') as g:
                g.write(bytearray.fromhex(CDF.V3magicNUMBER_1))
                g.write(bytearray.fromhex(CDF.V3magicNUMBER_2c))
                self._write_ccr(f, g, self.compression)

                if self.checksum:
                    g.seek(0, 2)
                    g.write(self._md5_compute(g))

        self.path.unlink()  # NOTE: for Windows this is necessary
        self.compressed_file.rename(self.path)
668998
def _close_pidfile(self):
        """"""
        if self._pid_fd is not None:
            os.close(self._pid_fd)
        try:
            os.remove(self.pidfile)
        except OSError as ex:
            if ex.errno != errno.ENOENT:
                raise