You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Holger Rauch <Ho...@heitec.de> on 2000/11/02 09:28:05 UTC

Re: Conditional chmod

Hi!

On Sun, 29 Oct 2000, Nico Seessle wrote:

> It should normally do exactly that, ignore it on Windows. This depends on
> several properties your Java VM provides. Can you run ant -debug and post
> the values for path.separator and os.name?

My colleague, who is working with Windows 2000, has run "ant
-verbose..." and received the following for path.separator and os.name

path.separator: ;
os.name: Windows 2000

Anyway, I don't have the faintest idea why a chmed is not ignored on Win*.

Thanks for any help!

Regards,

	Holger


Re: Conditional chmod - Windows attrib and cacls

Posted by Richard Beton <ri...@roke.co.uk>.
Nico Seessle wrote:

> If you can tell me (us) how to set file-permissions on Windows from Java it
> could be implemented. And I would really like to have a method to see
> file-permissions on Windows Servers (without ant, just using the
> command-line :-))

To read or set read-only flag use attrib
(type attrib /?) for help listing)

To display or modify access control lists, use cacls
(type cacls /? for help listing). cacls /e is particularly useful, I find.

Rick


Re: Conditional chmod

Posted by Nico Seessle <Ni...@epost.de>.
----- Original Message -----
From: "Martin Cooper" <ma...@tumbleweed.com>
To: <an...@jakarta.apache.org>
Sent: Thursday, November 02, 2000 10:05 AM
Subject: Re: Conditional chmod


> The point I am trying to make is that changing file permissions is *not*
> only relevant on one particular OS. Certainly, the way that the chmod
> command works, and the way its parameters are specified, is specific to
Unix
> and its variants. Changing file permissions, however, is applicable to
many
> OSs, Windows included.
>
> So why would Ant, an OS-independent build tool, ignore that fact, and
> implement it only for Unix and its variants, to the exclusion of other
OSs?
>

If you can tell me (us) how to set file-permissions on Windows from Java it
could be implemented. And I would really like to have a method to see
file-permissions on Windows Servers (without ant, just using the
command-line :-))

An "chmod 000" with MKS Toolkit on Win 2K just sets the readonly-flag for
me, so I think this is really useless...  and man chmod states:

r   Read permission.  If  this is off, you cannot read the file.  The FAT,
    extended FAT, HPFS, and NTFS file systems ignore this permission since
    all files are always readable.

which is wrong, since it is possible to revoke read-access thru clicking
around :-) (And if I revoke *all* rights thru Windows UI ls -l still shows
"-r-xr-xr-a"...)

Nico



Re: Conditional chmod

Posted by Peter Donald <do...@apache.org>.
At 01:05  2/11/00 -0800, you wrote:
>----- Original Message -----
>From: "Peter Donald" <do...@apache.org>
>
>
>> >Of course, calling the task 'chmod' in the first place does indicate a
>> >strong bias towards a certain OS on the part of the Ant developers, which
>> >seems more than a little inappropriate in a tool which purports to be OS
>> >independent...
>>
>> Well considering it is only relevent on one particular OS don't you think
>> it would be a little stupid to invent a different name for what everyone
>is
>> familiar with ?
>
>The point I am trying to make is that changing file permissions is *not*
>only relevant on one particular OS. Certainly, the way that the chmod
>command works, and the way its parameters are specified, is specific to Unix
>and its variants. Changing file permissions, however, is applicable to many
>OSs, Windows included.
>
>So why would Ant, an OS-independent build tool, ignore that fact, and
>implement it only for Unix and its variants, to the exclusion of other OSs?

Well because it is pure idocy to try and generalize things that are not
generalizable. It would be like trying to manage resource forks on unix or
win32 or perhaps manage ownership across multiple OSes. 

If you have system specific functionality you require ... then surprise
surprise you are going to need system specific commands.

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: Conditional chmod

Posted by Martin Cooper <ma...@tumbleweed.com>.
----- Original Message -----
From: "Peter Donald" <do...@apache.org>


> >Of course, calling the task 'chmod' in the first place does indicate a
> >strong bias towards a certain OS on the part of the Ant developers, which
> >seems more than a little inappropriate in a tool which purports to be OS
> >independent...
>
> Well considering it is only relevent on one particular OS don't you think
> it would be a little stupid to invent a different name for what everyone
is
> familiar with ?

The point I am trying to make is that changing file permissions is *not*
only relevant on one particular OS. Certainly, the way that the chmod
command works, and the way its parameters are specified, is specific to Unix
and its variants. Changing file permissions, however, is applicable to many
OSs, Windows included.

So why would Ant, an OS-independent build tool, ignore that fact, and
implement it only for Unix and its variants, to the exclusion of other OSs?

--
Martin Cooper
Tumbleweed Communications




Re: Conditional chmod

Posted by Peter Donald <do...@apache.org>.
At 12:44  2/11/00 -0800, you wrote:
>You ask why it isn't ignored on Windows? Actually, I've been wondering why
>it *is* ignored.
>

>Certainly, Windows doesn't support the same file modes that some other
>systems do, but how do I set or clear the read-only attribute on files under
>Windows? How about the archive attribute? Is there a Windows equivalent to
>the Unix chmod within Ant that I'm not aware of?

no one has found a need for it so no one has committed such a task.

>Of course, calling the task 'chmod' in the first place does indicate a
>strong bias towards a certain OS on the part of the Ant developers, which
>seems more than a little inappropriate in a tool which purports to be OS
>independent...

Well considering it is only relevent on one particular OS don't you think
it would be a little stupid to invent a different name for what everyone is
familiar with ?

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

RE: Conditional chmod

Posted by Conor MacNeill <co...@m64.com>.
Martin,

> -----Original Message-----
> From: Martin Cooper [mailto:martin.cooper@tumbleweed.com]
>
> You ask why it isn't ignored on Windows? Actually, I've been
> wondering why
> it *is* ignored.

I would say this is because there has been no need and no one has
submitted a patch to make it make sense. If you want to make it work, we
would definitely consider a contribution that makes chmod make sense
under windows. If you don't like the current name, then a contribution
that provides a new taskname could be considered too.

>
> Certainly, Windows doesn't support the same file modes that some other
> systems do, but how do I set or clear the read-only attribute
> on files under
> Windows? How about the archive attribute? Is there a Windows
> equivalent to
> the Unix chmod within Ant that I'm not aware of?

We'd be happy to have you write one.

>
> Of course, calling the task 'chmod' in the first place does indicate a
> strong bias towards a certain OS on the part of the Ant
> developers,

I think you should be careful about assuming anyone's biases from the
set of tasks that exist in ant. In fact ant was originally authored on a
Windows machine. For a long time it could not be bootstrapped under Unix
(http://marc.theaimsgroup.com/?l=tomcat-dev&m=86951938806952&w=2) Many
of the currently active committers do not use Unix machines, routinely.
I do most of my development on NT. I think the original author, Duncan,
prefers a Mac.

> which
> seems more than a little inappropriate in a tool which
> purports to be OS
> independent...

I wasn't involved at the time, but I am pretty sure the chmod task was
added to perform a particular task for tomcat and other nightly builds.
At one stage chmod would even crash on Windows systems but that has been
fixed long ago.

Ant is the product of its contributions from everyone who is willing to
submit code. I hope it is not the result of the biases of the
committers. We have our individual biases for sure. Well I have anyway,
I can't really speak for the others :-). Anyway I don't think they show
up in ant too much.

Conor


Re: Conditional chmod

Posted by Martin Cooper <ma...@tumbleweed.com>.
You ask why it isn't ignored on Windows? Actually, I've been wondering why
it *is* ignored.

Certainly, Windows doesn't support the same file modes that some other
systems do, but how do I set or clear the read-only attribute on files under
Windows? How about the archive attribute? Is there a Windows equivalent to
the Unix chmod within Ant that I'm not aware of?

Of course, calling the task 'chmod' in the first place does indicate a
strong bias towards a certain OS on the part of the Ant developers, which
seems more than a little inappropriate in a tool which purports to be OS
independent...

--
Martin Cooper
Tumbleweed Communications

----- Original Message -----
From: "Holger Rauch" <Ho...@heitec.de>
To: "Nico Seessle" <Ni...@epost.de>
Cc: <an...@jakarta.apache.org>
Sent: Thursday, November 02, 2000 12:28 AM
Subject: Re: Conditional chmod


> Hi!
>
> On Sun, 29 Oct 2000, Nico Seessle wrote:
>
> > It should normally do exactly that, ignore it on Windows. This depends
on
> > several properties your Java VM provides. Can you run ant -debug and
post
> > the values for path.separator and os.name?
>
> My colleague, who is working with Windows 2000, has run "ant
> -verbose..." and received the following for path.separator and os.name
>
> path.separator: ;
> os.name: Windows 2000
>
> Anyway, I don't have the faintest idea why a chmed is not ignored on Win*.
>
> Thanks for any help!
>
> Regards,
>
> Holger
>