[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'FileUtil' (#lcl)

# FileIsText

FileIsText - checks whether the supplied file name refers to a readable text file

## Declaration

Source position: line 0

`function FileIsText(`
`const AFilename: String`
`):Boolean; function FileIsText(`
`const AFilename: String;`
`out FileReadable: Boolean`
`):Boolean;`

## Arguments

`AFilename` |  | The name of the file for checking

## Function result

Returns True if the file is a text file

## Arguments

`AFilename` |  | The name of the file for checking
`FileReadable` |  | Returns false if a file reading Exception is encountered

## Function result

Returns True if the file is a text file

## Description

FileIsText - checks whether the supplied file name refers to a readable text file

Searches the opening section of the file (first 1024 characters) for non-text characters such as ASCII 0 to 31 (except CR and LF, the new line characters)

## Errors

If there is a file reading error, an Exception is raised and FileReadable returns False

The latest version of this document can be found at lazarus-ccr.sourceforge.net .