Fix file writing to be OS agnostic.
Authored by: b_calderwood 2013-04-23
Parent: [r7196]
Child: [r7198]