File.SetWritable Method

Definition

Overloads

SetWritable(Boolean)

A convenience method to set the owner's write permission for this abstract pathname.

SetWritable(Boolean, Boolean)

Sets the owner's or everybody's write permission for this abstract pathname.

SetWritable(Boolean)

A convenience method to set the owner's write permission for this abstract pathname.

[Android.Runtime.Register("setWritable", "(Z)Z", "GetSetWritable_ZHandler")]
public virtual bool SetWritable (bool writable);
[<Android.Runtime.Register("setWritable", "(Z)Z", "GetSetWritable_ZHandler")>]
abstract member SetWritable : bool -> bool
override this.SetWritable : bool -> bool

Parameters

writable
Boolean

If true, sets the access permission to allow write operations; if false to disallow write operations

Returns

true if and only if the operation succeeded. The operation will fail if the user does not have permission to change the access permissions of this abstract pathname.

Attributes

Remarks

A convenience method to set the owner's write permission for this abstract pathname.

An invocation of this method of the form file.setWritable(arg) behaves in exactly the same way as the invocation

file.setWritable(arg, true)

Added in 1.6.

Java documentation for java.io.File.setWritable(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

  • <xref:Java.IO.File.SetWritable(System.Boolean%2c+System.Boolean)>

Applies to

SetWritable(Boolean, Boolean)

Sets the owner's or everybody's write permission for this abstract pathname.

[Android.Runtime.Register("setWritable", "(ZZ)Z", "GetSetWritable_ZZHandler")]
public virtual bool SetWritable (bool writable, bool ownerOnly);
[<Android.Runtime.Register("setWritable", "(ZZ)Z", "GetSetWritable_ZZHandler")>]
abstract member SetWritable : bool * bool -> bool
override this.SetWritable : bool * bool -> bool

Parameters

writable
Boolean

If true, sets the access permission to allow write operations; if false to disallow write operations

ownerOnly
Boolean

If true, the write permission applies only to the owner's write permission; otherwise, it applies to everybody. If the underlying file system can not distinguish the owner's write permission from that of others, then the permission will apply to everybody, regardless of this value.

Returns

true if and only if the operation succeeded. The operation will fail if the user does not have permission to change the access permissions of this abstract pathname.

Attributes

Remarks

Sets the owner's or everybody's write permission for this abstract pathname.

The java.nio.file.Files class defines methods that operate on file attributes including file permissions. This may be used when finer manipulation of file permissions is required.

Added in 1.6.

Java documentation for java.io.File.setWritable(boolean, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to