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

Overwrite Default #20

Open
pyramid3d opened this issue Oct 21, 2023 · 1 comment
Open

Overwrite Default #20

pyramid3d opened this issue Oct 21, 2023 · 1 comment

Comments

@pyramid3d
Copy link

I like (and use) this lib.

I'd prefer the overwrite of the config file to be the default, as usually one just reads, updates, and saves settings.

inline static void write(..., const bool overwrite=true) {...
i
f (!overwrite) {
if (struct stat buf; stat(filepath.c_str(), &buf) == 0) {
throw std::runtime_error("file: " + filepath + " already exist.");
}
} else {
system(("rm -rf " + iniFileName).c_str());
}

@SSARCandy
Copy link
Owner

SSARCandy commented Oct 22, 2023

I see. Rather than adding default overwrite = true, I would prefer overwrite=false to make it having same behavior as before.
You can open PR for this. Great thanks~

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

2 participants