Detect if a configuratil file was changed
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.
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
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
Check if a file was modified externally (without YaST)
Function parameters
string file
Return value
boolean - true if was changed externally