You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rum Pel <ru...@hotmail.com> on 2002/06/04 07:12:01 UTC

chmod on windows

I thought all tasks are platform independant, but
chmod seems to work only on unix.
Whats the equivalent of chmod task on windows?

Also, is it possible to execute tasks based on conditions?
If os.family is unix
then
   chmod o-w file
else
if os.family is windows
then
   execute attrib -R file
endif.

The condition task doesnt seem to be for this purpose.

--rp.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: chmod on windows

Posted by Diane Holt <ho...@yahoo.com>.
--- Rum Pel <ru...@hotmail.com> wrote:
> Whats the equivalent of chmod task on windows?

Jesse Stockall submitted an Attrib task you could use. See:
  http://marc.theaimsgroup.com/?l=ant-dev&m=101196798606223&w=2

Excerpted from one of his follow-ups:
    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.

> Also, is it possible to execute tasks based on conditions?

The <exec> task allows for os.name, but not os.family -- the <condition>
task has a nested <os> condition that tests for various aspects of the OS
(see the doc for details).

If you want to stay with <exec>, you could use <condition> to set a
property for the name of the executable and the corresponding flags, then
reference those properties in your <exec> task.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>