size

open fun size(path: String, mustExist: Boolean = true): Long

Get the size of a file at path in bytes.

Return

the file size in bytes

Parameters

path

fully qualified path of the file

mustExist

if true, throws FileNotFoundException when path does not exist

Throws

if the size cannot be determined