GAP

Main Branches

Downloads  Installation  Overview  Data Libraries  Packages  Documentation  Contacts  FAQ  GAP 3 

Frequently Asked Questions

General Obtaining GAP Installation Hardware/OS Usage Complaints Computing with GAP Programming GAP


5. Usage hints

5.4: How can I save my GAP input and output?

The command LogTo( name-file ) causes the subsequent interaction to be logged to the file with the name name-file, i.e., everything you see on your terminal will also appear in this file. LogTo may also be used to log to a stream (see LogTo! for streams). This file must of course be writable by GAP, otherwise an error is signalled. Note that LogTo will overwrite the previous contents of this file if it already existed. See the reference manual section File Operations for information on this and related commands.

The command SaveWorkspace( filename ) will save a ``snapshot'' image of the current GAP workspace in the file filename. This image then can be loaded by another copy of GAP which then will behave as at the point when SaveWorkspace was called. See the section Saving and Loading a Workspace for information on this and related commands.

Further Yevgen Muntyan and David Joyner have written a function which automatically logs all GAP input and output. The log file is named after the time and date. It only works in linux.

The instructions are on a webpage Automatic Logging in GAP, however here are some details.

  • Download logger.gap from the webpage and save in /home/wdj/gapfiles/ (of course, change the path name /home/wdj/gapfiles/ to what you like).
  • Create the directory /home/wdj/gapfiles/log (of course, change the path name /home/wdj/gapfiles/ to what you have in (1))
  • Put the following 2 lines in your .gaprc file:
    Read(/home/wdj/gapfiles/logger.gap);
    autologger();
    where the path name /home/wdj/gapfiles/ is what you have in (1).

That's it! Now every GAP command is automaticaly logged and filed by date and time in the log subdirectory.