Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions library/std/src/sys/wasi/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub struct DirEntry {
pub struct OpenOptions {
read: bool,
write: bool,
append: bool,
dirflags: wasi::Lookupflags,
fdflags: wasi::Fdflags,
oflags: wasi::Oflags,
Expand Down Expand Up @@ -270,8 +271,9 @@ impl OpenOptions {
}
}

pub fn append(&mut self, set: bool) {
self.fdflag(wasi::FDFLAGS_APPEND, set);
pub fn append(&mut self, append: bool) {
self.append = append;
self.fdflag(wasi::FDFLAGS_APPEND, append);
}

pub fn dsync(&mut self, set: bool) {
Expand Down Expand Up @@ -321,7 +323,7 @@ impl OpenOptions {
base |= wasi::RIGHTS_FD_READ;
base |= wasi::RIGHTS_FD_READDIR;
}
if self.write {
if self.write || self.append {
base |= wasi::RIGHTS_FD_WRITE;
base |= wasi::RIGHTS_FD_DATASYNC;
base |= wasi::RIGHTS_FD_ALLOCATE;
Expand Down