LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   getting a directory's permissions and creating a new one with the same permissions (https://www.linuxquestions.org/questions/programming-9/getting-a-directorys-permissions-and-creating-a-new-one-with-the-same-permissions-168431/)

newbie1000101 04-10-2004 11:45 AM

getting a directory's permissions and creating a new one with the same permissions
 
i am very new in programming in linux and i am a bit confused. I am trying to get the permissions of an existing directory and creating a new one with the same permissions.
I manage to get the the existing directory's permissions but how can i use the output in mode_t mode to create the new directory?

david_ross 04-10-2004 12:52 PM

Welcome to LQ.

What about:
mkdir --mode=`stat --format=%a dir1` dir2


All times are GMT -5. The time now is 08:57 AM.