Add the possibility to change the filestate. #4047