File.SetReadable Method

Definition

Overloads

SetReadable(Boolean)

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

SetReadable(Boolean, Boolean)

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

SetReadable(Boolean)

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

[Android.Runtime.Register("setReadable", "(Z)Z", "GetSetReadable_ZHandler")]
public virtual bool SetReadable (bool readable);
[<Android.Runtime.Register("setReadable", "(Z)Z", "GetSetReadable_ZHandler")>]
abstract member SetReadable : bool -> bool
override this.SetReadable : bool -> bool

Parameters

readable
Boolean

If true, sets the access permission to allow read operations; if false to disallow read 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. If readable is false and the underlying file system does not implement a read permission, then the operation will fail.

Attributes

Remarks

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

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

file.setReadable(arg, true)

Added in 1.6.

Java documentation for java.io.File.setReadable(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.SetReadable(System.Boolean%2c+System.Boolean)>

Applies to

SetReadable(Boolean, Boolean)

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

[Android.Runtime.Register("setReadable", "(ZZ)Z", "GetSetReadable_ZZHandler")]
public virtual bool SetReadable (bool readable, bool ownerOnly);
[<Android.Runtime.Register("setReadable", "(ZZ)Z", "GetSetReadable_ZZHandler")>]
abstract member SetReadable : bool * bool -> bool
override this.SetReadable : bool * bool -> bool

Parameters

readable
Boolean

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

ownerOnly
Boolean

If true, the read permission applies only to the owner's read permission; otherwise, it applies to everybody. If the underlying file system can not distinguish the owner's read 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. If readable is false and the underlying file system does not implement a read permission, then the operation will fail.

Attributes

Remarks

Sets the owner's or everybody's read 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.setReadable(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