Creating files then Hiding them or making them Read-Only...how?
I know how to do File I/O, but now I want to be able to hide the files I create, just as if they had been Hidden from the Properties menu of the file. Is there any way I can do this? Thanks in advance!
void open(const char *filename, int mode, int access);
i may be wrong...
the open() function can take 3 arguments, with the 3rd argument being file access of type int
0 = normal //default
1 = read-only
2 = hidden
4 = system
8 = archive
so it looks something like this:
out.open(filename, ios::out, x); //where x is file access
it can be ORed with |
out.open("test.dat", ios::out, 1 | 2); //read-only and hidden
i believe you must send something (cant leave blank) as the 2nd argument in order to use the 3rd (file access)
only 1 out of the 4 books i'm using to learn c++ has mentioned this at all. play around with it and lemme know what kind of problems you encounter