Non basta impostare un'ACL restrittiva sulla cartella in questione?
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum