expanding File::write(is_insert == false) implementation