# 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

#### Since

2.2

#### 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())`.

#### Since

2.2

#### See also

fromFile(Object, String)