Change writeFile to writeRawFile