Reference/FileRead: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(Created page with "=FileRead= handle user_var(output) [maxlen] Reads a string (ANSI characters) from a file opened with FileOpen. The string is read until either a newline...") |
mNo edit summary |
||
| Line 14: | Line 14: | ||
FileClose $0 | FileClose $0 | ||
done:</highlight-nsis> | done:</highlight-nsis> | ||
''Command introduced with NSIS v1.60'' | |||
Latest revision as of 20:35, 4 June 2013
FileRead
handle user_var(output) [maxlen]
Reads a string (ANSI characters) from a file opened with FileOpen. The string is read until either a newline (or carriage return newline pair) occurs, or until a null byte is read, or until maxlen is met (if specified). By default, strings are limited to 1024 characters (a special build with larger NSIS_MAX_STRLEN can be compiled or downloaded). If the end of file is read and no more data is available, the output string will be empty, and the error flag will be set.
(If you are building a Unicode installer, the function reads an ANSI string and makes the adequate conversion)
ClearErrors FileOpen $0 $INSTDIR\file.dat r IfErrors done FileRead $0 $1 DetailPrint $1 FileClose $0 done:
Command introduced with NSIS v1.60