> -----Original Message-----
> From: Stefan Bodewig [mailto:[EMAIL PROTECTED]] 
> Sent: 21 November 2002 07:51
> To: [EMAIL PROTECTED]
> Subject: Re: Changing files attributes
> 
> 
> On Thu, 21 Nov 2002, Janusz Dalecki <[EMAIL PROTECTED]> wrote:
> 
> > I need to change the attributes of the files that are 
> copied after the 
> > ant build is done.
> 
> Ant 1.6 will have an <attrib> task.

In the meantime, and for earlier Ant versions, I've been using <exec>
with the Windows "attrib" program to mimic "chmod":

        <target name="get.db"   depends="do.get"        if="db.path">
                <!-- make the database(s) read-write: -->
                <exec   dir="${db.path}"
                                executable="attrib.exe">
                        <arg    value="-R"/>
                </exec>
                <echo>
(database(s) in directory: ${db.path} is/are now writable)
                </echo>
        </target>

This should be self-explanatory - the crucial part is the <exec> task.
The "-R" argument instructs attrib to make everything in the ${db.path}
directory writable (-R == NOT read-only).

> 
> I think the task itself should work with Ant 1.5.1 as well, 
> so you can download the source from 
<http://cvs.apache.org/viewcvs.cgi/jakarta-ant/src/main/org/apache/tools
/ant/taskdefs/optional/windows/Attrib.java>
> compile and <taskdef> it.
>
> Documentation of the task itself is here
<http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-ant/docs/manual/Op
tionalTasks/attrib.html?rev=HEAD&content-type=text/html>
>
> Stefan

Got to admit though, a dedicated task that worked on Windows and *nix
would be a much nicer solution.

HTH,
John

--
John Niven
Please reply via newsgroup/mailing-list. 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to