Add replace, shared, and toread flags