public static int getFlags(String filename) throws HsqlException {

    try {
      ScaledRAFile raFile =
          (ScaledRAFile)
              ScaledRAFile.newScaledRAFile(filename, true, ScaledRAFile.DATA_FILE_RAF, null, null);

      raFile.seek(FLAGS_POS);

      int flags = raFile.readInt();

      raFile.close();

      return flags;
    } catch (IOException e) {
      throw Trace.error(Trace.DATA_FILE_ERROR);
    }
  }