Opens the *.data file for this cache.
543969
public void open(boolean readonly) {

        try {
            dataFile = ScaledRAFile.newScaledRAFile(database, fileName, false,
                    ScaledRAFile.DATA_FILE_RAF, null, null);
            fileFreePosition = INITIAL_FREE_POS;

            initBuffers();

            freeBlocks = new DataFileBlockManager(0, cacheFileScale, 0);
        } catch (Throwable e) {
            database.logger.appLog.logContext(e, null);
            close(false);

            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_DataFileCache_open, new Object[] {
                e, fileName
            });
        }
    }
1054603
def open(mode = "r")
      # Fat32 module methods use miqfs instance accessors to touch @boot_sector.
      @mode = mode.downcase
      @de = ifs_getFile(@path, @miqfs)
      unless @de.nil?
        raise "File is directory: '#{@path}'" if @de.isDir?
      end
      if mode.include?("r")
        raise "File not found: '#{@path}'" if @de.nil?
        @data = FileData.new(@de, @miqfs.boot_sector)
      end
      if mode.include?("w")
        @de.delete(@miqfs.boot_sector) unless @de.nil?
        @de, @parentDirCluster = ifs_putFile(@path, @miqfs)
        @data = FileData.new(@de, @miqfs.boot_sector)
      end
      if mode.include?("a")
        @de, @parentDirCluster = ifs_putFile(@path, @miqfs) if @de.nil?
        @data = FileData.new(@de, @miqfs.boot_sector) if @data.nil?
        @data.read
      end
    end
1020500
def open(self, mode='rb'):
        
        file = self.storage.open(self.relative_name, mode=mode)  # type: File
        return file
1131289
void open() {
        if (askToSave()) {
            return;
        }

        boolean loading = true;
        SaveType fileType;
        tryAgain: while (loading) {
            int value = saveOpenFileChooser.showOpenDialog(mainFrame);
            if (value != JFileChooser.APPROVE_OPTION) {
                return;
            }

            loading = false;
            fileType = convertFilterToType(saveOpenFileChooser.getFileFilter());
            final File f = saveOpenFileChooser.getSelectedFile();

            if (!fileType.isValid(f)) {
                JOptionPane.showMessageDialog(saveOpenFileChooser, "That file is not compatible with the chosen file type",
                        "Invalid File", JOptionPane.WARNING_MESSAGE);
                loading = true;
                continue;
            }

            switch (fileType) {
            case XML_ANALYSIS:
                if (!f.getName().endsWith(".xml")) {
                    JOptionPane.showMessageDialog(saveOpenFileChooser,
                            L10N.getLocalString("dlg.not_xml_data_lbl", "This is not a saved bug XML data file."));
                    loading = true;
                    continue tryAgain;
                }

                if (!mainFrame.openAnalysis(f, fileType)) {
                    // TODO: Deal if something happens when loading analysis
                    JOptionPane.showMessageDialog(saveOpenFileChooser, "An error occurred while trying to load the analysis.");
                    loading = true;
                    continue tryAgain;
                }
                break;
            case FBP_FILE:
                if (!openFBPFile(f)) {
                    // TODO: Deal if something happens when loading analysis
                    JOptionPane.showMessageDialog(saveOpenFileChooser, "An error occurred while trying to load the analysis.");
                    loading = true;
                    continue tryAgain;
                }
                break;
            case FBA_FILE:
                if (!openFBAFile(f)) {
                    // TODO: Deal if something happens when loading analysis
                    JOptionPane.showMessageDialog(saveOpenFileChooser, "An error occurred while trying to load the analysis.");
                    loading = true;
                    continue tryAgain;
                }
                break;
            default:
                assert false;
            }
        }
    }
781995
def open_attributes_file(self):
        '''
        
        '''
        if not self.saveable():
            raise AttributeError("Cannot open attribute file without a valid file")
        if self._db_closed:
            self._fd = FileDict(self._file_name, db_ext=self._db_ext,
                                   read_only=self._read_only, clear=False, cache_size=0,
                                   immutable_vals=False, stringify_keys=False,
                                   cache_misses=False)
            self._db_closed = False
324291
def open(self):
        """"""
        with open(self.filename, 'rb') as file_open:
            binary = file_open.read()

        try:
            return binary.decode()
        except UnicodeDecodeError:
            encoding = get_encoding(binary)
            try:
                return binary.decode(encoding)
            except LookupError:
                return binary.decode(errors='ignore')
            except:  # pylint: disable=W0702
                open_error(self.filename)
        except:  # pylint: disable=W0702
            open_error(self.filename)
587732
public void open(boolean readonly) {

        fileFreePosition = 0;

        database.logger.appLog.logContext(SimpleLog.LOG_NORMAL, "start");

        try {
            boolean preexists = database.isFilesInJar();
            long    freesize  = 0;

            if (!preexists && fa.isStreamElement(fileName)) {

                // OOo related code
                if (database.isStoredFileAccess()) {
                    preexists = true;
                }

                // OOo end
                if (!preexists) {

                    // discard "empty" databases
                    File f = new File(fileName);

                    preexists = f.length() > INITIAL_FREE_POS;
                }
            }

            if (preexists) {
                String version = database.getProperties().getProperty(
                    HsqlDatabaseProperties.hsqldb_cache_version);
                boolean v17 =
                    HsqlDatabaseProperties.VERSION_STRING_1_7_0.equals(
                        version);

                // for later versions
                boolean v18 =
                    HsqlDatabaseProperties.VERSION_STRING_1_8_0.equals(
                        version);

                if (!v17) {
                    throw Error.error(ErrorCode.WRONG_DATABASE_FILE_VERSION);
                }
            }

            boolean isNio = database.getProperties().isPropertyTrue(
                HsqlDatabaseProperties.hsqldb_nio_data_file);
            int fileType = isNio ? ScaledRAFile.DATA_FILE_NIO
                                 : ScaledRAFile.DATA_FILE_RAF;

            if (database.isFilesInJar()) {
                fileType = ScaledRAFile.DATA_FILE_JAR;
            }

            // oj@openofice.org - change to file access api
            String cname =
                database.getURLProperties().getProperty("storage_class_name");
            String skey =
                database.getURLProperties().getProperty("storage_key");

            dataFile = ScaledRAFile.newScaledRAFile(database, fileName,
                    readonly, fileType, cname, skey);

            if (preexists) {
                dataFile.seek(FLAGS_POS);

                int flags = dataFile.readInt();

                hasRowInfo = BitMap.isSet(flags, FLAG_ROWINFO);

                dataFile.seek(LONG_EMPTY_SIZE);

                freesize = dataFile.readLong();

                dataFile.seek(LONG_FREE_POS_POS);

                fileFreePosition = dataFile.readLong();

                if (fileFreePosition < INITIAL_FREE_POS) {
                    fileFreePosition = INITIAL_FREE_POS;
                }

                if (!readonly && fileFreePosition != INITIAL_FREE_POS
                        && incBackup) {
                    shadowFile = new RAShadowFile(database, dataFile,
                                                  backupFileName,
                                                  fileFreePosition, 1 << 14);
                }
            } else {
                fileFreePosition = INITIAL_FREE_POS;

                dataFile.seek(LONG_FREE_POS_POS);
                dataFile.writeLong(INITIAL_FREE_POS);

                // set unsaved flag;
                dataFile.seek(FLAGS_POS);
                dataFile.writeInt(0);
            }

            initBuffers();

            fileModified = false;
            freeBlocks = new DataFileBlockManager(maxFreeBlocks,
                                                  cacheFileScale, freesize);

            database.logger.appLog.logContext(SimpleLog.LOG_NORMAL, "end");
        } catch (Throwable e) {
            database.logger.appLog.logContext(e, "failed");
            close(false);

            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_DataFileCache_open, new Object[] {
                e, fileName
            });
        }
    }
637733
public void open() {
        if (log.isTraceEnabled()) {
            // dump memory stats
            log.trace("Memory at open - free: {}K total: {}K", Runtime.getRuntime().freeMemory() / 1024, Runtime.getRuntime().totalMemory() / 1024);
        }
    }
510179
def _load(self):
        
        if self.is_exists():
            return open(self._ref, "rb").read()
        raise NotFoundError("File %s not found" % self._ref)
407544
def load(self):
        """"""
        if self.is_file_persisted:
            self.object_file.open()
            temp = dill.loads(self.object_file.read())
            self.set_object(temp)
            self.object_file.close()
816878
def open_files(self, idx=0):
        """"""
        self.elements.open_files(idx=idx)
        self.nodes.open_files(idx=idx)
183428
def open(self, external_dir=None):
        
        if self.kind == 'data':
            with io.BytesIO(self._data.data) as f:
                yield f
        elif self.kind == 'external':
            filepath = self._data.linked_file[b'fullPath'].value
            filepath = filepath.replace('\x00', '').replace('file://', '')
            if not os.path.exists(filepath):
                filepath = self._data.linked_file[b'relPath'].value
                filepath = filepath.replace('\x00', '')
                if external_dir is not None:
                    filepath = os.path.join(external_dir, filepath)
            if not os.path.exists(filepath):
                raise FileNotFoundError(filepath)
            with open(filepath, 'rb') as f:
                yield f
        else:
            raise NotImplementedError('alias is not supported.')
1332331
def from_file(self, filename):
        """"""
        f = open(filename, 'rb')
        while True:
            data = f.read(10480)
            if not data:
                break
            self.update(data)
        f.close()
1192714
def try_opening_file(self):
        ''''''
        if os.path.isfile(self.path):
            self.file = open(self.path, 'r')
            self.file_is_opened = True
583357
def open(self, filename, mode='r', **kwargs):
        '''
        
        '''
        if 'r' in mode and not self.backend.exists(filename):
            raise FileNotFound(filename)
        return self.backend.open(filename, mode, **kwargs)
263689
def _openResources(self):
        
        with Image.open(self._fileName) as image:
            self._array = np.asarray(image)
            self._bands = image.getbands()

            # Fill attributes. For now assume that the info item are not overridden by
            # the Image items.
            self._attributes = dict(image.info)
            self._attributes['Format'] = image.format
            self._attributes['Mode'] = image.mode
            self._attributes['Size'] = image.size
            self._attributes['Width'] = image.width
            self._attributes['Height'] = image.height
1251724
def open(self):
        """"""
        filename = self.dialogs.getOpenFileName(filter="*.%s" % self.FTYPE)
        if filename:
            self.new(filename)