init: Use std::string for write_file() am: ef52ae14ab  -s ours
am: 94db9479ce

Change-Id: Ib7585390594f363c267f6974586205e022df85f3