Complete template WriteFile