ofFile::remove() sharing violation:

Hi all…

so, under windows, When trying to remove some files, any files, I get sharing violation,

(using poco::remove)
if I use old-shool c++ remove(char *) file is removed no problem

If I open the file first using ofFile then call raw remove(char *)

ofFile test(“file.txt”);

Then file cannot be removed until I release ofFile

This indicates that ofFile is not allowing the file to be deleted because it is using it.

under osx (same OF version with poco) no problem, even if deleting from smb (windows share)

I am a bit reluctant in using c++ raw remove function … though I also bet poco is using it

I tried readWrite mode, still same problem…

  • I should clarify that I use an older version of OF, because I cannot use any other alternative

I would appreciate it if someone could just verify if std::filesystem::remove() works under windows in the latest OF version…

Or if anyone has any idea if I am forgetting something, like a trick to make ofFile::remove() work under windows…

Kind Regards

One last thing,

What is the difference between


and old school raw c++ *remove(char ) function??

Ok, My bad, If I use Reference in the Mode argument everything works great