What\'s the simplest way to copy the unix file permissions of a file and set them to another file? Is there a way to store a file\'s permissions to a variable and then use t
Sure. Use stat() and chmod() (may need root).
stat()
chmod()
#include struct stat st; stat("/foo/bar.txt", &st); chmod("/baz/quirk.jpg", st.st_mode);