My program receives an executable binary file through a TCP socket.
I need to save this file in to the harddisk as a executable program. File is successfully received but the problem is the default file attribute is being set to non executable.
How to change the file’s attribute as executable in C in Ubuntu?
Thank you,
Regards,
Robo
How about
int chmod(const char *path, mode_t mode)andint fchmod(int fd, mode_t mode) ?
The most basic example: