states.file.replace(append/prepend_if_not_found)
Merge pull request #11171 from ze42/dev_replace_state

states.file.replace(append/prepend_if_not_found)