# fromFile

abstract fun fromFile(file: Any, charset: String): TextResource(source)

Creates a text resource backed by the given file.

#### Return

a text resource backed by the given file

#### Parameters

file

a text file evaluated as per files

charset

the file's character encoding (e.g. `"utf-8"`)

abstract fun fromFile(file: Any): TextResource(source)

Same as `fromFile(file, Charset.defaultCharset())`.

#### See also

fromFile(Object, String)