Add mode flag to file_writeOnce().