write_chunk_file_append_only

Function write_chunk_file_append_only 

Source
pub fn write_chunk_file_append_only(path: &Path, content: &str) -> Result<bool>
Expand description

Writes or appends a single .ctbnodes chunk file using strictly append-only semantics:

  • If path already exists and equals content, does not open the file for writing (Ok(false)).
  • If path already exists and is a strict byte prefix of content, opens path with O_WRONLY | O_APPEND (compatible with kernel chattr +a) and writes only the newly appended tail.
  • If path already exists and is NOT a strict byte prefix of content, fails loudly (Err).
  • If path does not exist yet, creates it with O_WRONLY | O_CREAT | O_EXCL.