71. FileChanges

Detect if a configuratil file was changed

71.1. Authors

  • Jiri Srain <jsrain@suse.cz>

  • Support routines for detecting changes of configuration files being done

  • externally (not by YaST) to prevent the changes from being lost because

  • of YaST not handling the configuration files correctly (eg. removing

  • comments in some cases, changing order of options,...)

  • Warns user if such change is detected.

  • Usage:

  • Before reading the configuration file:

  • call boolean CheckFiles (list<string>) with all files. If any of them

  • is detected to be changed, YaST asks a popup for you.

  • alternatively use boolean FileChanged (string) for each file (does not

  • ask any question, immediatelly returns status of the file

  • After writing the configuraiton file:

  • call void StoreFileCheckSum (string) for each file to store recent

  • checksum. YaST will use this checksum next time checking.

71.2. Summary of Module Globals

List of Global Functions

  • CheckFiles - Check files if any of them were changed Issue a question whether to continue if some were chaned

  • FileChanged - Check if a file was modified externally (without YaST)

  • StoreFileCheckSum - Store checksum of a file to the store

List of Global Variables

    71.3. Global Functions

    71.3.1. CheckFiles

    Check files if any of them were changed Issue a question whether to continue if some were chaned

    Function parameters

    • list<string> files

    Return value

    • boolean - true if either none was changed or user agreed to continue

    71.3.2. FileChanged

    Check if a file was modified externally (without YaST)

    Function parameters

    • string file

    Return value

    • boolean - true if was changed externally

    71.3.3. StoreFileCheckSum

    Store checksum of a file to the store

    Function parameters

    • string file

    Return value

    • void

    71.4. Global Variables

    71.5. Module Requirements

    71.5.1. Module Imports

    • Directory
    • Label
    • Mode
    • Popup

    71.5.2. Module Includes