There's a DOS command "attrib" which does exactly that.

usage:

attrib -R fileName (make the file writable)
attrib +R fileName (make the file readonly)

Jian"Chuck" Ma
KMV LLC
1620 Montgomery St. Suite 140
San Francisco, CA 94111
415-352-1157(w)




-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 18, 2002 5:02 PM
To: Ant Users List
Subject: Re: Changing file permissions in Win32


Or <exec> to a command-line tool like 'cacls' (builtin to Win2k, not sure if
its builtin or part of the Resource Kit for NT4).


----- Original Message -----
From: "T Master" <[EMAIL PROTECTED]>
To: "Ant Users List" <[EMAIL PROTECTED]>
Sent: Friday, January 18, 2002 7:17 PM
Subject: Re: Changing file permissions in Win32


> The problem is, java only supports a File.setReadOnly()  method.
> Even this on Win2000 is unreliable.
>
> There is no File.allowWritePermission() and  File.allowReadPermission() in
> Java unfortunately.
>
>
> A true  fully functioning <chmod> task  would probably make system calls
for
> adding read/write permission.
>
>
> ----- Original Message -----
> From: "Ron Coutts" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 18, 2002 4:45 PM
> Subject: Changing file permissions in Win32
>
>
> Does anyone know a task for changing a file permission in Win32, like
> the 'chmod' task does in Unix?  I need to change a read-write file to a
> read-only.
>
> Ron
>
>
>
> --
> 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]>

Reply via email to