You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by lawardy <er...@yahoo.com> on 2008/02/21 04:03:08 UTC

Set up folder permission in Windows with Ant

Hi,

I'm a new user of ant. I am trying to set up a folder and need to set up
certain permission on it (read, write and execute permission)Is it possible
to do with ant?

Any idea of how to do that. I have looked around the web with no luck.
Please help.

Regards,

Lawardy
-- 
View this message in context: http://www.nabble.com/Set-up-folder-permission-in-Windows-with-Ant-tp15603955p15603955.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Set up folder permission in Windows with Ant

Posted by Charbel BITAR <bi...@gmail.com>.
Hi,

Just use the chmod task...
http://ant.apache.org/manual/CoreTasks/chmod.html

HTH
--
Charbel

On Thu, Feb 21, 2008 at 4:03 AM, lawardy <er...@yahoo.com> wrote:

>
> Hi,
>
> I'm a new user of ant. I am trying to set up a folder and need to set up
> certain permission on it (read, write and execute permission)Is it
> possible
> to do with ant?
>
> Any idea of how to do that. I have looked around the web with no luck.
> Please help.
>
> Regards,
>
> Lawardy
> --
> View this message in context:
> http://www.nabble.com/Set-up-folder-permission-in-Windows-with-Ant-tp15603955p15603955.html
> Sent from the Ant - Dev mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Re: Set up folder permission in Windows with Ant

Posted by Steve Loughran <st...@apache.org>.
lawardy wrote:
> Hi,
> 
> I'm a new user of ant. I am trying to set up a folder and need to set up
> certain permission on it (read, write and execute permission)Is it possible
> to do with ant?
> 
> Any idea of how to do that. 


1. this is the kind of question for the ant users list

2. Windows? it doesnt have that usable a permissions model. You need to 
edit ACLs, which you can do by <exec>-ing CACLS:


 >cacls /?
Displays or modifies access control lists (ACLs) of files

CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]
                [/P user:perm [...]] [/D user [...]]
    filename      Displays ACLs.
    /T            Changes ACLs of specified files in
                  the current directory and all subdirectories.
    /E            Edit ACL instead of replacing it.
    /C            Continue on access denied errors.
    /G user:perm  Grant specified user access rights.
                  Perm can be: R  Read
                               W  Write
                               C  Change (write)
                               F  Full control
    /R user       Revoke specified user's access rights (only valid with 
/E).
    /P user:perm  Replace specified user's access rights.
                  Perm can be: N  None
                               R  Read
                               W  Write
                               C  Change (write)
                               F  Full control
    /D user       Deny specified user access.
Wildcards can be used to specify more that one file in a command.
You can specify more than one user in a command.

Abbreviations:
    CI - Container Inherit.
         The ACE will be inherited by directories.
    OI - Object Inherit.
         The ACE will be inherited by files.
    IO - Inherit Only.
         The ACE does not apply to the current file/directory.

I would advise you avoid it unless you know what you are going. To 
create zip/tar files with permissions, use <zipfileset> and <tarfileset> 
filesets with explicitly listed permssions.

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org