added some code
wrote some code to test some functionallity
This commit is contained in:
27
src/client_backend/permissions.cpp
Normal file
27
src/client_backend/permissions.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef PERMISSIONS_CPP
|
||||
#define PERMISSIONS_CPP
|
||||
#include "permissions.h"
|
||||
/*
|
||||
1 create file (as admin)
|
||||
2 set file as read only (also as admin)
|
||||
file cannot be deleted or modified by anyone. admin can delete
|
||||
|
||||
*/
|
||||
/*
|
||||
int main() {
|
||||
FILE* fp;
|
||||
fp = fopen("c:\\programdata\\jakach\\aa.txt", "w");
|
||||
fprintf(fp, "secure text");
|
||||
fclose(fp);
|
||||
chmod("c:\\programdata\\jakach\\aa.txt", _S_IREAD);
|
||||
}
|
||||
|
||||
*/
|
||||
int protect_file(char* path) {
|
||||
return _chmod(path, _S_IREAD);
|
||||
}
|
||||
int unprotect_file(char* path) {
|
||||
return _chmod(path, _S_IWRITE | _S_IREAD);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user