-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Using FileStorage::APPEND #14130
Copy link
Copy link
Labels
Milestone
Description
I cannot read data written in file when I use FileStorage:: APPEND
my code :
FileStorage fs;
fs.open("test.yml", FileStorage::WRITE);
fs << "a" << 48;
fs.release();
fs.open("test.yml", FileStorage::APPEND);
fs << "b" << 49;
fs.release();
fs.open("test.yml", FileStorage::READ);
cout << int(fs["a"]) << endl;
cout << int(fs["b"]) << endl;
result :
a = 48
b = 0
yml file is
%YAML:1.0
---
a: 48
...
---
b: 49
It works using xml file
PS I cannot find previous issue about append problem in yml but I can find many post on stackoverflow
Reactions are currently unavailable