Skip to content

feat: implement write#406

Open
Sl1mb0 wants to merge 4 commits intomainfrom
tm/write
Open

feat: implement write#406
Sl1mb0 wants to merge 4 commits intomainfrom
tm/write

Conversation

@Sl1mb0
Copy link
Contributor

@Sl1mb0 Sl1mb0 commented Mar 14, 2026

Closes #337

  • feat: implement write
  • test: add unit tests for write functionality There are notably two test cases that we do not test: - Writing an empty buffer to a directory - Writing to a directory The reason we do not test these is because these errors are caught by open_at; which is required to be called before we can perform writes (a descriptor is required); hence it's impossible to get a write descriptor for a directory.
  • refactor: return ErrorCode::Unsupported for write_via_stream to indicate that it is not currently implemented
  • test: add integration test for write behavior Notably, this asserts that if a write is attempted by the python guest we will see ErrorCode::Unsupported. This is because under the hood Python uses write_via_stream; and not write.

Sl1mb0 added 4 commits March 11, 2026 12:14
There are notably two test cases that we do *not* test:
  - Writing an empty buffer to a directory
  - Writing to a directory
The reason we do not test these is because these errors are caught by open_at; which is required to be called before we can perform writes (a descriptor *is* required); hence it's impossible to get a write descriptor for a directory.
Notably, this asserts that if a write is attempted by the python guest we will see ErrorCode::Unsupported. This is because under the hood Python uses write_via_stream; and not write.
path: "/test",
err: "OK",
content: "hello world",
expected: "ERR: [Errno 58] Not supported",
Copy link
Contributor Author

@Sl1mb0 Sl1mb0 Mar 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to highlight this one. I'll implement write_via_stream in a follow-up.

@Sl1mb0 Sl1mb0 requested a review from crepererum March 14, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement HostDescriptor::write for VfsCtxView

1 participant