# filemetadata module

`binaryninja.filemetadata.FileMetadata`([...]) | `class FileMetadata` represents the file being analyzed by Binary Ninja. It is responsible for opening,
`binaryninja.filemetadata.NavigationHandler` |

class `binaryninja.filemetadata.``FileMetadata`(filename=None, handle=None)

  Bases: `object`

  `class FileMetadata` represents the file being analyzed by Binary Ninja. It is responsible for opening, closing, creating the database (.bndb) files, and is used to keep track of undoable actions.

  `analysis_changed`

    Boolean result of whether the auto-analysis results have changed (read-only)

  `begin_undo_actions`()

    `begin_undo_actions` start recording actions taken so the can be undone at some point.

    Return type: | None

    Example:

        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>> bv.begin_undo_actions()
        >>> bv.convert_to_nop(0x100012f1)
        True
        >>> bv.commit_undo_actions()
        >>> bv.get_disassembly(0x100012f1)
        'nop'
        >>> bv.undo()
        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>>

  `close`()

    Closes the underlying file handle. It is recommended that this is done in a finally clause to avoid handle leaks.

  `commit_undo_actions`()

    `commit_undo_actions` commit the actions taken since the last commit to the undo database.

    Return type: | None

    Example:

        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>> bv.begin_undo_actions()
        >>> bv.convert_to_nop(0x100012f1)
        True
        >>> bv.commit_undo_actions()
        >>> bv.get_disassembly(0x100012f1)
        'nop'
        >>> bv.undo()
        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>>

  `create_database`(filename, progress_func=None)
  `filename`

    The name of the file (read/write)

  `get_view_of_type`(name)
  `has_database`

    Whether the FileMetadata is backed by a database (read-only)

  `modified`

    Boolean result of whether the file is modified (Inverse of ‘saved’ property) (read/write)

  `navigate`(view, offset)
  `navigation`
  `offset`

    The current offset into the file (read/write)

  `open_existing_database`(filename, progress_func=None)
  `raw`

    Gets the “Raw” BinaryView of the file

  `redo`()

    `redo` redo the last commited action in the undo database.

    Return type: | None

    Example:

        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>> bv.begin_undo_actions()
        >>> bv.convert_to_nop(0x100012f1)
        True
        >>> bv.commit_undo_actions()
        >>> bv.get_disassembly(0x100012f1)
        'nop'
        >>> bv.undo()
        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>> bv.redo()
        >>> bv.get_disassembly(0x100012f1)
        'nop'
        >>>

  `save_auto_snapshot`(progress_func=None)
  `saved`

    Boolean result of whether the file has been saved (Inverse of ‘modified’ property) (read/write)

  `session_data`

    Dictionary object where plugins can store arbitrary data associated with the file

  classmethod `set_default_session_data`(name, value)
  `undo`()

    `undo` undo the last commited action in the undo database.

    Return type: | None

    Example:

        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>> bv.begin_undo_actions()
        >>> bv.convert_to_nop(0x100012f1)
        True
        >>> bv.commit_undo_actions()
        >>> bv.get_disassembly(0x100012f1)
        'nop'
        >>> bv.undo()
        >>> bv.get_disassembly(0x100012f1)
        'xor     eax, eax'
        >>> bv.redo()
        >>> bv.get_disassembly(0x100012f1)
        'nop'
        >>>

  `view`

class `binaryninja.filemetadata.``NavigationHandler`

  Bases: `object`