Fixing file permissions after modifying in C++? Fixing file permissions after modifying in C++? linux linux

Fixing file permissions after modifying in C++?


If you want to avoid using system(), you can use

#include <sys/stat.h>int chmod(const char *path, mode_t mode);

It is documented in http://linux.die.net/man/3/chmod.

See also: C++ - How to set file permissions (cross platform).


If you include stdlib.h, you can use system("command").

Try it:

system("chmod 755 yourExeFile")