pub fn check_or_write( check: bool, path: impl AsRef<Path>, contents: impl AsRef<[u8]>, ) -> Result<()>