NT permissions
-
Hello, just wondering if anyone has tried to backup NT permissions of a file or directory and store it in a flat file so the permissions could be restored at a later date if needed? Is this even possible? If anyone has any experience in this can you give me a pointer where to start? Thanks Whoever said nothing's impossible never tried slamming a revolving door!
-
Hello, just wondering if anyone has tried to backup NT permissions of a file or directory and store it in a flat file so the permissions could be restored at a later date if needed? Is this even possible? If anyone has any experience in this can you give me a pointer where to start? Thanks Whoever said nothing's impossible never tried slamming a revolving door!
To store:
CFileStatus stat;
CFile::GetStatus("file", stat);
CFile file("attr.out", CFile::modeWrite);
file.Write(&(stat.rStatus), sizeof(stat.rStatus));
file.Close();To load:
CFileStatus stat;
CFile file("attr.out", CFile::modeRead);
file.Read(&(stat.rStatus), sizeof(stat.rStatus));
file.Close();
CFile::SetStatus("file", stat);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow