Xuanwo commented on code in PR #3023:
URL:
https://github.com/apache/incubator-opendal/pull/3023#discussion_r1328242980
##########
core/src/services/fs/backend.rs:
##########
@@ -566,10 +578,24 @@ impl Accessor for FsBackend {
(p, None)
};
- let f = std::fs::OpenOptions::new()
- .create(true)
- .truncate(true)
- .write(true)
+ let mut f = std::fs::OpenOptions::new();
+ f.create(true).write(true);
+
+ if op.append() {
+ f.append(true);
+
+ // If the target file exists, we should append to the end of it
directly.
+ if Path::new(&target_path)
Review Comment:
How about do this check in `if let Some(atomic_write_dir) {}` block, so that
we can avoid those cost if `atomic_write` not enabled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]