Invalid permissions set for newly created directory

This is the code creating the cache folder with the wrong permissions:

mkdir($saveFolder, 02775); 

When I check folder permissions using ls -la , I get:

 drwxr-sr-x 

But instead, I expect:

 drwxrwsr-x 
+5
source share
1 answer

For some unclear reasons (at least for me) changing the code to

 mkdir($saveFolder); chmod($saveFolder, 02775); 

solved a problem.

Now I get the correct permissions set in the folder:

 drwxrwsr-x 
+4
source

Source: https://habr.com/ru/post/1232025/


All Articles