Hi,

I have one problem deleting a file with boost. The file is opened in another application and cannot be deleted.
I am supposed to received an exception error but I don't get it. Any idea why?

Here is my piece of code, very simple:
Code:
bool delete_file(const string &path) {
 
    boost::filesystem::path bpath(path);
    try {
        if (boost::filesystem::remove(bath)) return true;
        else return false;
    }
    catch (const boost::filesystem::filesystem_error &e) {

        return false;

    }
    return false;

}
I have put a breakpoint inside the catch part but it does not come to this point.
Instead, the the output window of visual studio, I got these lines:

First-chance exception at 0x00007FFD2E575A88 in site_server.exe: Microsoft C++ exception: boost::filesystem::filesystem_error at memory location 0x00000070F8E3E920.
Unhandled exception at at 0x00007FFD2E575A88 in site_server.exe: Microsoft C++ exception: boost::filesystem::filesystem_error at memory location 0x00000070F8E3E920.

I would appreciate if someone could explain me how to manage this situation?

Thank you for reading,

madric