Skip to content

Commit

Permalink
write_exclusive (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeiPatiakin authored Dec 4, 2024
1 parent 4fba3f4 commit e7008f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/iceberg/src/io/file_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ impl OutputFile {
writer.close().await
}

/// Create a new output file with given bytes.
/// Error out if the file already exists
pub async fn write_exclusive(&self, bs: Bytes) -> crate::Result<()> {
self.op
.write_with(&self.path[self.relative_path_pos..], bs)
.if_none_match("*")
.await?;
Ok(())
}

/// Creates output file for continues writing.
///
/// # Notes
Expand Down

0 comments on commit e7008f3

Please sign in to comment.