%FIO_ReadWholeFile function


Function The function reads a specified file and inserts its contents into a variable of Text type.
Declaration
 TEXT %FIO_ReadWholeFile(
  TEXT in fileName
 [,TEXT in encoding = "@APP_DEFAULT@"]
  ) 
Parameters
fileName File name (full path).
encoding Optional parameter of Text typ - type of file encoding. If it is not defined, its default value is "@APP_DEFAULT@". For reading of binary file, you must use "Binary" encoding.
The list of supported encodings in ESL.
Return value The function returns the contents of the specified file.

If the size of the file is more than 1 MB or the files do not exist, the function returns invalid value.
Note The function uses binary mode to read the file.
Example
 BEGIN
   TEXT _data
   _data := %FIO_ReadWholeFile("c:\datafile")
 END 

Napíšte komentár