DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(history.info.gz) Managing the History File

Info Catalog (history.info.gz) Searching the History List (history.info.gz) History Functions (history.info.gz) History Expansion
 
 2.3.6 Managing the History File
 -------------------------------
 
 The History library can read the history from and write it to a file.
 This section documents the functions for managing a history file.
 
  -- Function: int read_history (const char *filename)
      Add the contents of FILENAME to the history list, a line at a time.
      If FILENAME is `NULL', then read from `~/.history'.  Returns 0 if
      successful, or `errno' if not.
 
  -- Function: int read_history_range (const char *filename, int from,
           int to)
      Read a range of lines from FILENAME, adding them to the history
      list.  Start reading at line FROM and end at TO.  If FROM is zero,
      start at the beginning.  If TO is less than FROM, then read until
      the end of the file.  If FILENAME is `NULL', then read from
      `~/.history'.  Returns 0 if successful, or `errno' if not.
 
  -- Function: int write_history (const char *filename)
      Write the current history to FILENAME, overwriting FILENAME if
      necessary.  If FILENAME is `NULL', then write the history list to
      `~/.history'.  Returns 0 on success, or `errno' on a read or write
      error.
 
  -- Function: int append_history (int nelements, const char *filename)
      Append the last NELEMENTS of the history list to FILENAME.  If
      FILENAME is `NULL', then append to `~/.history'.  Returns 0 on
      success, or `errno' on a read or write error.
 
  -- Function: int history_truncate_file (const char *filename, int
           nlines)
      Truncate the history file FILENAME, leaving only the last NLINES
      lines.  If FILENAME is `NULL', then `~/.history' is truncated.
      Returns 0 on success, or `errno' on failure.
 
Info Catalog (history.info.gz) Searching the History List (history.info.gz) History Functions (history.info.gz) History Expansion
automatically generated byinfo2html