how we copy a buffer depends on the env