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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -