Opens `path` for writing, creating it if missing with owner-only permissions applied at create time (Unix), so a fresh file never exists with umask-default permissions before the trailing `set_private_file_permissions` call. Pre-existing files keep their mode here and are tightened by that trailing call.
(path: &Path, options: &mut fs::OpenOptions)
| 486 | /// `set_private_file_permissions` call. Pre-existing files keep their |
| 487 | /// mode here and are tightened by that trailing call. |
| 488 | fn open_private(path: &Path, options: &mut fs::OpenOptions) -> io::Result<fs::File> { |
| 489 | options.create(true); |
| 490 | apply_private_create_mode(options); |
| 491 | options.open(path) |
| 492 | } |
| 493 | |
| 494 | pub fn write_file_atomically(path: &Path, temp_path: &Path, contents: &[u8]) -> io::Result<()> { |
| 495 | if path_parent(path) != path_parent(temp_path) { |
nothing calls this directly
no test coverage detected