rewrite file object