Update test1.cpp

This commit is contained in:
ihsinme
2021-11-15 16:29:51 +03:00
committed by GitHub
parent 99740876cb
commit c916bed853

View File

@@ -7,11 +7,11 @@ int fclose(FILE *stream);
int main(int argc, char *argv[])
{
//umask(0022);
umask(0022);
FILE *fp;
fp = fopen("myFile.txt","w"); // BAD
//chmod("myFile.txt",0644);
fp = fopen("myFile.txt","w"); // GOOD
chmod("myFile.txt",0644);
fprintf(fp,"%s\n","data to file");
fclose(fp);
return 0;
}
}