LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-10-2004, 11:45 AM   #1
newbie1000101
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
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?
 
Old 04-10-2004, 12:52 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Welcome to LQ.

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating groups, adding users, and setting permissions bowie101 Linux - Newbie 2 11-23-2005 12:42 PM
Creating a user with no permissions... defa0009 Linux - Newbie 4 05-15-2005 02:24 PM
Creating users in SSH and permissions. Unleashed2k Linux - Networking 2 05-03-2004 10:55 AM
Viewing my root password / creating an all permissions user ssobeht Linux - Security 16 11-01-2003 01:25 PM
Creating file link -- user needs permissions? AnthonyM Linux - General 1 07-07-2003 12:18 PM


All times are GMT -5. The time now is 02:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration