Skip to content

firma_fs

Filesystem helpers shared by OpenFirma crates.

Choose the helper by contract:

  • [create_private_dir_all] creates a directory tree and, on Unix, ensures the final directory ends with private permissions.
  • [write_private_file] writes a file that must always end with private permissions on Unix.
  • [write_file] writes a file whose final Unix mode is chosen by the caller.
  • [write_new_file] is the create-once variant of [write_file]. Pair it with [FsError::kind] when std::io::ErrorKind::AlreadyExists is a non-fatal outcome.

The file helpers write only the target file. They do not create parent directories; provision those separately with [create_private_dir_all] or another directory-creation step first.

On non-Unix platforms, the helpers fall back to the closest stdlib behavior. That means Unix mode arguments and permission-tightening guarantees are ignored where the platform does not expose them.

1 enum, 1 struct, 4 functions

1 function