Skip to main content

create_private_dir_all

Function create_private_dir_all 

Source
pub fn create_private_dir_all(path: &Path) -> Result<()>
Expand description

Create a directory tree with owner-only permissions on Unix (0o700), making newly created dirents crash-durable (same fsync chain as create_dir_all_durable).

Used for .heddle / ~/.heddle trees that hold credentials, keys, and repository secrets. On Unix, missing ancestors are created with mode 0o700 and then fsynced deepest-first, plus the deepest pre-existing parent. On non-Unix platforms this falls back to durable create_dir_all_durable (no portable POSIX mode API). Existing directories are left as-is (creation-time privacy; callers that need to tighten existing modes should do so explicitly).