468,531 Members | 1,605 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,531 developers. It's quick & easy.

mkdir - do not inherit permissions


I'm working on windows here..
i have a script that makes directories, subdirs (mkdir) and I afterwards set special permissions with xcacls trough a system call.

But when I took a closer look at the advanced security permissions, I saw that mkdir makes permission inheritance, when creating the subdirectories:

main dir is ok, but sub dir permissions:
Inherited From: permissions inherited by [main dir]

And I don't want that to happen.
Anyone knows how to do this?? Would using system(mkdir ...) avoid this? Or is there a perl solution (I would prefer)..?
Aug 13 '09 #1
2 4141
3,503 Expert Mod 2GB
That would be an issue with the windows mkdir command, since you are using the system() function. Have you tried using Perl's built in mkdir function? You can set permission through it, but I don't know if that will work since they are Unix type permissions. You can test it though and see. Otherwise, you might have to modify permissions, unless the windows mkdir command has options you can feed it.


Aug 13 '09 #2
Well, I tried with system(mkdir .. ) and with perl command mkdir..
Both have the same result.

But I found the solution and it is really simple in fact..
(why didn't I thought of it before.. sigh)

Just use xcacls and put the following parameter:
Expand|Select|Wrap|Line Numbers
  1. /I REMOVE
This will uncheck the "inherit from parent folder" checkbox and remove inherited access rights.

Hope this will be usefull to others too..
Aug 14 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by joelbyrd | last post: by
5 posts views Thread by eoindeb | last post: by
30 posts views Thread by MikeC | last post: by
8 posts views Thread by vj | last post: by
2 posts views Thread by banning | last post: by
1 post views Thread by B | last post: by
3 posts views Thread by fouadk | last post: by
1 post views Thread by Icecrack | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.