Hi,
There are a number of ways you can change file permissions from within your C code. Here are the prototypes for library functions that come to mind:
Code:
/* To create a new file, specifying the 'mode' (permissions) */
int creat(const char *pathname, mode_t mode);
/* To modify the permissions of a file by name */
int chmod(const char *path, mode_t mode);
/* To modify the permissions of a file by descriptor */
int fchmod(int fildes, mode_t mode);
Check the respective man pages for details on the accepted values for 'mode'.
Cheers,