use raw_write everywhere