Rewrite file assembling.