Chown Task (1.0rc4)

Wilfred Springer


Description

Changes ownership of files on Unix. It accepts FileSets specifying the files of which ownership should be changed. When a file already is owned by the specified user/group, then this task will simply try to change ownership again, but this will hardly ever be noticed. An attempt to change ownership for files that are not accessible for the current user will break the build.

Parameters

AttributeDescriptionRequired
user The name of the new user of the files. Yes, unless group is set.
group The name of the new group of the files. Yes, unless user is set.

Nested Elements

fileset

You can use multiple fileset elements to specifiy the files of which ownership must be changed. These fileset elements may specify both files and directories.

Examples

Example 1. Change the owner of some files

	<chown user="wilfred">
	<fileset dir="/tmp">
	<includes name="*.bak"/>
	</fileset>
	</chown>
      

Example 2. Change the group of some files

	<chown group="staff">
	<fileset dir="/tmp">
	<includes name="*.bak"/>
	</fileset>
	</chown>