unix - c copy file permissions from another file -


what's simplest way copy unix file permissions of file , set them file? there way store file's permissions variable , use variable set permissions file?

sure. use stat() , chmod() (may need root).

#include <sys/stat.h>  struct stat st; stat("/foo/bar.txt", &st); chmod("/baz/quirk.jpg", st.st_mode); 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -