Freigeben über


File.SetReadOnly Method

Definition

Marks the file or directory named by this abstract pathname so that only read operations are allowed.

[Android.Runtime.Register("setReadOnly", "()Z", "GetSetReadOnlyHandler")]
public virtual bool SetReadOnly ();
[<Android.Runtime.Register("setReadOnly", "()Z", "GetSetReadOnlyHandler")>]
abstract member SetReadOnly : unit -> bool
override this.SetReadOnly : unit -> bool

Returns

true if and only if the operation succeeded; false otherwise

Attributes

Remarks

Marks the file or directory named by this abstract pathname so that only read operations are allowed. After invoking this method the file or directory will not change until it is either deleted or marked to allow write access. Whether or not a read-only file or directory may be deleted depends upon the underlying system.

Added in 1.2.

Java documentation for java.io.File.setReadOnly().

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

See also

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