reopens the datalogger. It is assumed that the logger is open.

@param accessMode
@throws IOException
@throws java.lang.IllegalStateException
logger isn't open
541934
public void reopen(AccessMode accessMode) throws IOException {

		if (this.randomAccess == null) {
			associatedRandomAccessFile();
		}

		this.accessMode = accessMode;

		// write start sequences ...
		switch (accessMode) {
		case READ:
			maybeRead();
			// start reading from the fiorts position
			this.randomAccess.rewind();
			break;
		case WRITE:
			maybeWritten();
			this.randomAccess.reset();
			break;
		case APPEND:
			maybeWritten();
			this.randomAccess.forwardWind();
			break;
		default:
			throw new IllegalArgumentException("Invalid AccessMode "
					+ accessMode);
		}

	}
293820
public void replay(IDataLoggerReplay replay) throws IOException {
		maybeRead();
		this.randomAccess.rewind();
		while (this.randomAccess.available() > (Integer.SIZE / Byte.SIZE)) {

			int length = this.randomAccess.readInt();
			short type = this.randomAccess.readShort();
			XALogRecordType recordType = XALogRecordType.resolve(type);
			byte[][] data = new byte[length][];
			for (int i = 0; i < length; i++) {
				int recordSize = this.randomAccess.readInt();
				data[i] = this.randomAccess.read(recordSize);
			}
			replay.onRecord(recordType, data);
		}

	}
1206909
public static void logErrorRetrieveArchive(final Logger logger,
			final ArchiveDescription archive, final Error e)
	{

		logger.logError(Level.ERROR, "Error while accessing archive "
				+ archive.toString(), e);
	}
1161850
public void close() {
        logger.debug("Try to close accessFile and channel for file: " + osFile);
        if (headerBuffer != null) {
            headerBuffer.force();
            headerBuffer = null;
        }

        try {
            unlock();
            if (channel != null && channel.isOpen()) {
                channel.close();
                channel = null;
            }

            if (accessFile != null) {
                accessFile.close();
                accessFile = null;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        logger.debug("Closed accessFile and channel for file: " + osFile);
    }
1099543
def reopen_io(io, path, mode = nil)
      begin
        if mode
          io.reopen(path, mode)
        else
          io.reopen(path)
        end
        io.binmode
      rescue ::Exception
      end
    end
817528
@Override
    @Trivial
    public void open() throws ClassSource_Exception {
        String methodName = "open";
        if ( tc.isDebugEnabled() ) {
            Tr.debug(tc, MessageFormat.format("[ {0} ] [ {1} ] ENTER/RETURN", getHashText(), methodName));
        }
    }
226932
public void setMode(long mode) throws IOException {
        setAttributes(
                new NfsSetAttributes(Long.valueOf(mode), null, null, NfsTime.DO_NOT_CHANGE, NfsTime.DO_NOT_CHANGE));
    }
1301508
def _set_access_log(self, config, level):
        
        access_handler = self._get_param(
            'global',
            'log.access_handler',
            config,
            'syslog',
            )

        # log format for syslog
        syslog_formatter = logging.Formatter(
            "ldapcherry[%(process)d]: %(message)s"
            )

        # replace access log handler by a syslog handler
        if access_handler == 'syslog':
            cherrypy.log.access_log.handlers = []
            handler = logging.handlers.SysLogHandler(
                address='/dev/log',
                facility='user',
                )
            handler.setFormatter(syslog_formatter)
            cherrypy.log.access_log.addHandler(handler)

        # if stdout, open a logger on stdout
        elif access_handler == 'stdout':
            cherrypy.log.access_log.handlers = []
            handler = logging.StreamHandler(sys.stdout)
            formatter = logging.Formatter(
                'ldapcherry.access - %(levelname)s - %(message)s'
            )
            handler.setFormatter(formatter)
            cherrypy.log.access_log.addHandler(handler)
        # if file, we keep the default
        elif access_handler == 'file':
            pass

        # replace access log handler by a null handler
        elif access_handler == 'none':
            cherrypy.log.access_log.handlers = []
            handler = logging.NullHandler()
            cherrypy.log.access_log.addHandler(handler)

        # set log level
        cherrypy.log.access_log.setLevel(level)
725530
def open(self, mode=MODE_READ):
        
        if mode not in [MODE_READ, MODE_WRITE]:
            error = "Open mode must be '{}' or '{}'".format(
                MODE_READ, MODE_WRITE)
            raise ValueError(error)
        self._openMode = mode
        if mode == MODE_READ:
            self.assertExists()
        if mode == MODE_READ:
            # This is part of the transitional behaviour where
            # we load the whole DB into memory to get access to
            # the data model.
            self.load()
615549
public void setTimes(String src, long mtime, long atime) throws IOException {
    if ( !accessTimeTouchable && atime != -1) {
      throw new AccessTimeException("setTimes is not allowed for accessTime");
	}    
    setTimesInternal(src, mtime, atime);
    getEditLog().logSync(false);
  }
193103
def open_file(self, access_mode="r"):
        
        try:
            with open(self, access_mode, encoding='utf-8') as file:
                return file.read()

        except IOError:
            print(self + " File not found.")
            sys.exit(0)
935793
protected void openEditDialog(boolean isNew, String mode, CmsEditHandlerData handlerDataForNew) {

        CmsContainerpageController.get().getContentEditorHandler().openDialog(
            m_editableData,
            isNew,
            m_parentResourceId,
            mode,
            handlerDataForNew);
    }
809687
public void updateMode(Boolean developmode) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
	if (!hasAccess) throw new SecurityException("no access to update scope setting");

	Element mode = _getRootElement("mode");
	mode.setAttribute("develop", Caster.toString(developmode, ""));
    }
995004
def chmod(self, mode):
        
        if self._closed:
            self._raise_closed()
        self._accessor.chmod(self, mode)
1527
public void reopen(FileInputSplit split, Tuple3<Long, Long, GenericDataType[]> state) throws IOException {
		this.customSchema = state.f2;
		this.open(split);
		this.getOfficeReader().getCurrentParser().setCurrentSheet(state.f0);
		this.getOfficeReader().getCurrentParser().setCurrentRow(state.f1);

	}
841177
public final void zooActivateRead() {
		if (DBTracer.TRACE) DBTracer.logCall(this);
		switch (getStatus()) {
		case DETACHED_CLEAN:
			//nothing to do
			return;
		case HOLLOW_PERSISTENT_NONTRANSACTIONAL:
			try {
				Session session = context.getSession();
				session.lock();
				if (session.isClosed()) {
					throw DBLogger.newUser("The PersistenceManager of this object is not open.");
				}
				if (!session.isActive() && !session.getConfig().getNonTransactionalRead()) {
					throw DBLogger.newUser("The PersistenceManager of this object is not active " +
							"(-> use begin()).");
				}
				jdoZooGetNode().refreshObject(this);
			} finally {
				context.getSession().unlock();
			}
			return;
		case PERSISTENT_DELETED:
		case PERSISTENT_NEW_DELETED:
			throw DBLogger.newUser("The object has been deleted.");
		case PERSISTENT_NEW:
		case PERSISTENT_CLEAN:
		case PERSISTENT_DIRTY:
			//nothing to do
			return;
		case TRANSIENT:
		case TRANSIENT_CLEAN:
		case TRANSIENT_DIRTY:
			//not persistent yet
			return;

		default:
			throw new IllegalStateException("" + getStatus());
		}
	}
733831
@Override
	public final void unlock(int handle) throws DataStoreException 
    {
        if (SAFE_MODE) checkHandle(handle);
        if (locks.flip(handle))
        {
            locks.flip(handle); // Restore state
            throw new DataStoreException("Handle was not locked : "+handle);
        }
    }