September 20th, 2010, 11:42 AM
Create read-only file using c++
I want to create a log file that captures all the actions happening...anyway i got code for that from internet.
Now what i want to do is, make that file read only so that the data is not modified by external application or user.
time_t now = time(0);
struct tm* tm = localtime(&now);
ofstream out( "logfileBrandNew.log",ios::app);
out << tm->tm_year << '/' << tm->tm_mon << '/' << tm->tm_mday
<< ' ' << tm->tm_hour << ':' << tm->tm_min << ':' << tm->tm_sec
<< ": ";
out << msg << "\n";
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.