Skip to content

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

Closed
@mqudsi

Description

@mqudsi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions