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...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
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.


Line 12: Line 13:
FileClose $0
FileClose $0
done:</highlight-nsis>
done:</highlight-nsis>
''Command introduced with NSIS v1.80''

Latest revision as of 20:45, 4 June 2013

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:

Command introduced with NSIS v1.80