Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that AccessFs::WriteFile may also require Truncate #79

Open
mrcnski opened this issue Jan 14, 2025 · 1 comment · May be fixed by #80
Open

Document that AccessFs::WriteFile may also require Truncate #79

mrcnski opened this issue Jan 14, 2025 · 1 comment · May be fixed by #80

Comments

@mrcnski
Copy link

mrcnski commented Jan 14, 2025

Hello, I recently ran into a case where I was trying to use std::fs::write on a file with the AccessFs::WriteFile access right. This doesn't work, because std::fs::write first truncates:

This is a convenience function for using File::create and write_all with fewer imports.

I had only ever used ABI::V1 before, where this isn't an issue. When I tried ABI::V4 this was suddenly breaking.

Suggested Fix

Under AccessFs::WriteFile, document something like:

Certain operations (such as std::fs::write) may also require Truncate since ABI::V3.

If that sounds reasonable, I could do that along with #53 in one PR. :)

@l0kod
Copy link
Member

l0kod commented Jan 15, 2025

Hello, I recently ran into a case where I was trying to use std::fs::write on a file with the AccessFs::WriteFile access right. This doesn't work, because std::fs::write first truncates:

This is a convenience function for using File::create and write_all with fewer imports.

I had only ever used ABI::V1 before, where this isn't an issue. When I tried ABI::V4 this was suddenly breaking.

Suggested Fix

Under AccessFs::WriteFile, document something like:

Certain operations (such as std::fs::write) may also require Truncate since ABI::V3.

That would be useful.

If that sounds reasonable, I could do that along with #53 in one PR. :)

Yes please!

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 a pull request may close this issue.

2 participants