LibGAP Workspace Support - C/C++ Library Interfaces

Skip to content
Back to top
View this page
Edit this page

# LibGAP Workspace Support

The single purpose of this module is to provide the location of the libgap saved workspace and a time stamp to invalidate saved workspaces.

sage.libs.gap.saved_workspace.timestamp()

  Return a time stamp for (lib)gap.

  OUTPUT:

  Float. Unix timestamp of the most recently changed GAP/LibGAP file(s). In particular, the timestamp increases whenever a gap package is added.

  EXAMPLES:

  Sage

      sage: from sage.libs.gap.saved_workspace import timestamp
      sage: timestamp()   # random output
      1406642467.25684
      sage: type(timestamp())
      <... 'float'>

  Python

      >>> from sage.all import *
      >>> from sage.libs.gap.saved_workspace import timestamp
      >>> timestamp()   # random output
      1406642467.25684
      >>> type(timestamp())
      <... 'float'>

sage.libs.gap.saved_workspace.workspace(name='workspace')

  Return the filename of the gap workspace and whether it is up to date.

  INPUT:

  - `name` – string; a name that will become part of the workspace filename

  OUTPUT:

  Pair consisting of a string and a boolean. The string is the filename of the saved libgap workspace (or that it should have if it doesn’t exist). The boolean is whether the workspace is up-to-date. You may use the workspace file only if the boolean is `True`.

  EXAMPLES:

  Sage

      sage: from sage.libs.gap.saved_workspace import workspace
      sage: ws, up_to_date = workspace()
      sage: ws
      '/.../gap/libgap-workspace-...'
      sage: isinstance(up_to_date, bool)
      True

  Python

      >>> from sage.all import *
      >>> from sage.libs.gap.saved_workspace import workspace
      >>> ws, up_to_date = workspace()
      >>> ws
      '/.../gap/libgap-workspace-...'
      >>> isinstance(up_to_date, bool)
      True