%FIO_ReadWholeFile function


FunctionThe 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
fileNameThe File name (full path).
encodingOptional 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 valueThe function returns the contents of the specified file.

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

Napíšte komentár