https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101510
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think you are still confused between the bool that crate_directory returns, and the bool that you get from !ec The bool that is returned tells you if a new directory was created. The bool you get from !ec tells you if the directory exists (whether it was created or already existed).