Use writeFileEnsureLn
in place of writeFile
#2604
Merged
writeFileEnsureLn
in place of writeFile
#2604