Skip to content

Nodes loaded from file read-only? #363

@EMC3

Description

@EMC3

Hello,

I wrote this simple code:

YAML::Node n = YAML::LoadFile(file); // as described in the tutorial

I have no problems accessiong the contents of n, and the file exists. But as soon as i write

n["whatever"] = somevalue;

i get an YAML::BadSubscript exception (what(): operator[] call on a scalar). Is this a bug or are loaded nodes read-only? If i create the node by writing

YAML::Node n;

i can write into without any problem.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions