I use the POCO library and I need to create a database SQLite at the beginning of my program so that I can then write and read data into it. How can I do it? I wrote the following code:
std::filesystem::path data_root_path("var/opt");
auto data_dir_path = data_root_path / "agent" / "data" / "module";
auto database_file = data_dir_path / "database.db";
// register SQLite connector
Poco::Data::SQLite::Connector::registerConnector();
database_ = Poco::makeShared<Poco::Data::Session("SQLite",database_file.string());
But I get the following error:
FileNotFound
I work on Linux OS, maybe I don't have access rights to create a database file? How can I check this? I gave the local user write access to the folder.
Could you tell me how to create a database file using the library POCO?
data_dir_path. See mason.gmu.edu/~montecin/UNIXpermiss.htm To check you can usels -lah /var/opt/nf-agent/data/LDPModulecommand. See also kb.iu.edu/d/abdb