ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Stockall <je...@cryptocard.com>
Subject Re: [SUBMIT] Attrib task (chmod for Windows)
Date Fri, 25 Jan 2002 18:07:52 GMT
On Fri, 2002-01-25 at 12:47, Peter Janes wrote:
> As a simple example, take something like
> 
> <set-permissions
>    file="foo"
>    executable="true"
>    readonly="true"
>    hidden="true"
> />
> 
> On Windows (which doesn't have "executable" files) this would translate to
> 
>    attrib +r +h foo
> 
> On UNIX (which doesn't have "hidden" files) it would become
> 
>    chmod 0555 foo
> 

This is fine if you want all user to have the same permissions.

But you would be losing most of the current chmod's capabilities. Keep
in mind that you have the following choices

ugoa (user, group, other, all)
+-=  (add, remove, only)
rwxXstugo  (r) read 
	   (w) write
	   (x) execute (or access for directo­ries)
	   (X) execute only if the file is a directory or already has 	   
execute permission for some user
	   (s) set user or group ID on execution
	   (t) sticky
	   (u) the permissions that the user who owns the file currently 	   
has for it
	   (g) the permissions that other users in the file's group have 	   
for it 
	   (o) and the permissions that other users not in the file's 	   
group have for it


That is allot of combinations to handle gracefully.

With the chmod task for Unix & the Attrib task for Windows I can make a
file read-only for both platforms with the following

<chmod file="${src}/file.java" perm="-w"/>
<attrib file="${src}/file.java" perm="+R"/>

Each task is only executed on the appropriate platform.

-- 
 Jesse Stockall			|	Tel: 1+ 613.599.2441 ext. 243
 CRYPTOCard Corporation		|	Fax: 1+ 613.599.2442	 	
 Suite 304, 300 March Rd.	|	email: jesse@cryptocard.com
 Ottawa, ON, Canada K2K 2E2	|	web: www.cryptocard.com 
---------------------------------------------------------------------


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


Mime
View raw message