speed up c++, rm files if exist