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

The trace file DB cannot be deleted under Windows OS #47

Open
maestrosoft opened this issue Aug 22, 2024 · 1 comment
Open

The trace file DB cannot be deleted under Windows OS #47

maestrosoft opened this issue Aug 22, 2024 · 1 comment

Comments

@maestrosoft
Copy link

The TlmRecorder::openDB(const std::string& dbName) function does create the ifstream object with the file name: std::ifstream f(dbName.c_str()); Then check if the file exists with if (f.good()). So far so good however remove(dbName.c_str()) always fails to delete the file under Windows. It seems internally Windows does open the file when f.good() is called. Then the remove call will fail with a shared violation status. To fix the issue f.close() must be called before the remove call.

@derchr
Copy link
Collaborator

derchr commented Sep 16, 2024

Thanks for reporting this issue. We should probably use std::filesystem::remove anyways as it's more portable.

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