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

OpenOptions::append documentation should clarify file creation behavior #44432

Closed
mqudsi opened this issue Sep 8, 2017 · 0 comments
Closed

Comments

@mqudsi
Copy link
Contributor

mqudsi commented Sep 8, 2017

The documentation for OpenOptions is somewhat incomplete as it confusingly leaves out any mention of the file creation behavior.

The current description reads

This option, when true, means that writes will append to a file instead of overwriting previous contents. Note that setting .write(true).append(true) has the same effect as setting only .append(true).

While it is true that append() only sets (or clears) the append flag, I think it might be wise to include something to the effect of

If the file does not already exist at the specified path, .create(true) must also be supplied prior to calling .open() or else an error will be raised.

mqudsi added a commit to neosmart/relaunch that referenced this issue Sep 8, 2017
This was caused by the confusion stemming from the OpenOptions::append
documentation, bugged here:
rust-lang/rust#44432
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

No branches or pull requests

1 participant