Rewrite file managing