MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / open_private

Method open_private

src/storage.rs:488–492  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 2

openMethod · 0.45

Tested by

no test coverage detected