I think it may be very slow because you are in fact executing "chown -R
user:web" for every single file under the ${dir} directory. Since the -R
switch to chown already recurses into sub-dirs, what you need is more
something like:
<exec executable="sh" dir="${dir}>
<arg line="chown -R user:web" />
</exec>
Or instead, modify your existing <apply> as follows:
<apply executable="chown" dir="${dir}" type="both" parallel="true">
<arg value="-R"/>
<arg value="user:web"/>
<fileset dir="${dir}" includes="*" />
</apply>
Let me know why one works best. Regards, --DD
-----Original Message-----
From: David Adams [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 5:36 PM
To: Ant Users List
Subject: RE: Newbie question about exec/chown
That seemed to work. Here is the end result:
<apply executable="chown" dir="${dir}" type="both">
<arg value="-R"/>
<arg value="user:web"/>
<fileset dir="${dir}"/>
</apply>
It is quite a bit slower than the shell command itself (using bash), but
it works.
-----Original Message-----
From: Dominique Devienne [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 5:04 PM
To: 'Ant Users List'
Subject: RE: Newbie question about exec/chown
Command line expansion is performed by the shell, not the unix command
themselves. So execute sh or bash or csh or whatever other shell, adding
chown in front of your arg line.
Or use <apply> with a <fileset>. --DD
-----Original Message-----
From: David Adams [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 5:01 PM
To: [EMAIL PROTECTED]
Subject: Newbie question about exec/chown
All,
I am trying to write an exec task in UNIX to chown a directory and files
(as
well as the subdirectories). The task command I am using is:
<exec dir="${dir}" executable="chown" os="SunOS">
<arg line="-R user:web ${dir}/*"/>
</exec>
This returns:
[exec] chown: /data/netscape/docs/target/*: No such file or
directory
[exec] Result: 1
This seems to come out well when I <echo> the entire task command.
Any thoughts?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Adams
Ignite Sports (www.ignitesports.com)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>