File.Length Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the length of the file denoted by this abstract pathname.
[Android.Runtime.Register("length", "()J", "GetLengthHandler")]
public virtual long Length ();
[<Android.Runtime.Register("length", "()J", "GetLengthHandler")>]
abstract member Length : unit -> int64
override this.Length : unit -> int64
Returns
The length, in bytes, of the file denoted by this abstract
pathname, or 0L
if the file does not exist. Some
operating systems may return 0L
for pathnames
denoting system-dependent entities such as devices or pipes.
- Attributes
Remarks
Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory.
Where it is required to distinguish an I/O exception from the case that 0L
is returned, or where several attributes of the same file are required at the same time, then the java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) Files.readAttributes
method may be used.
Java documentation for java.io.File.length()
.
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.