I am testing the mkdir function to create a new directory:
folder = mkdir("./linux", 511);
or
folder = mkdir("./linux", 0777);
or
folder = mkdir("./linux", S_IRWXU | S_IRWXG | S_IRWXO);
As you can see, I am trying to allow full permission for the directory, but here what appears with ls -l | grep linux ls -l | grep linux :
drwxr-xr-x 2 manuzhang manuzhang 4096 2012-01-04 06:53 linux
Why can't I allow write access for the group and others?
Update :
it is strange how you guys told me that I tried umask . It works with either umask(S_IWGRP) or umask(S_IWOTH) , but it crashes with umask(S_IWGRP | S_IWOTH) , any ideas?
source share