Fix CopyFile to allow updating readonly files