Reference/FileReadByte: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with "=FileReadByte= handle user_var(output) Reads a byte from a file opened with FileOpen. The byte is stored in the output as an integer (0-255). If the end o...")
 
Line 1: Line 1:
=FileReadByte=
=FileReadByte=


handle user_var(output)
handle user_var(output)
 
Reads a byte from a file opened with [[Reference/FileOpen|FileOpen]]. The byte is stored in the output as an integer (0-255). If the end of file is read and no more data is available, the output will be empty, and the error flag will be set.
Reads a byte from a file opened with [[Reference/FileOpen|FileOpen]]. The byte is stored in the output as an integer (0-255). If the end of file is read and no more data is available, the output will be empty, and the error flag will be set.



Revision as of 20:10, 27 November 2011

FileReadByte

handle user_var(output)

Reads a byte from a file opened with FileOpen. The byte is stored in the output as an integer (0-255). If the end of file is read and no more data is available, the output will be empty, and the error flag will be set.

ClearErrors
FileOpen $0 $INSTDIR\file.dat r
IfErrors done
FileReadByte $0 $1
FileReadByte $0 $2
DetailPrint "$1 $2"
FileClose $0
done: