Append To A File In Rust
August 2023
This is how I append to a file in Rust
use OpenOptions;
use Write;
Notes
-
The
create(true)makes the file if it doesn't already exist. Without that, the process will throw an error if the file isn't already there. - Could also update it to return a result for things working or not. I haven't needed that yet. I expect it'll come in hand at some point.
end of line