R/fileHasChanged.R

Defines functions .fileHasChanged

#-----------------
# compareHash
#----------------
# Private function to determine if the .model file has changed

.fileHasChanged <- function(model_file, hash_file) {
  # Calculate hash for current model file
  current_hash <- as.character(md5sum(model_file))

  # Read saved hash
  saved_hash <- readLines(hash_file, n = 1)

  # Compare the hashed
  has_changed <- current_hash != saved_hash
  return(has_changed)
}

Try the MCSimMod package in your browser

Any scripts or data that you put into this service are public.

MCSimMod documentation built on Aug. 21, 2025, 5:54 p.m.