Anybody know how to set file attributes at runtime? Like if I wanted to create a hidden file, or make a file an archive after I've written to it.
Anybody know how to set file attributes at runtime? Like if I wanted to create a hidden file, or make a file an archive after I've written to it.
# include <stdlib>
using std::system;
...
system ("attrib +h filename.txt");
...
+ sets an attribute
- clears an attribute
R read-only file attribute.
A Archive File attribute.
S system File attribute
H hidden file attribute
/S processes all file in all directories in specified path
Blue
hmm I was hoping to find some way to do it without system, but if that's the only way..
I know that there are API calls for it. I have only ever used them to get the attributes and file information so far. Check out
MSDN.microsoft.com.
CreateFile()
Hello, everyone.
there is a chmod() to do that. forgot which header... dos.h/dir.h dont remember.
-