Simple put this line..

system ("attrib +r logfileBrandNew.log");

or use SetFileAttributes API..