Reference/FileSeek: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with "=FileSeek= handle offset [mode] [user_var(new position)] Seeks a file opened with FileOpen. If mode is omitted or specified as SET, the file is position...")
 
mNo edit summary
 
Line 13: Line 13:
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

FileSeek

handle offset [mode] [user_var(new position)]

Seeks a file opened with FileOpen. If mode is omitted or specified as SET, the file is positioned to "offset", relative to the beginning of the file. If mode is specified as CUR, then the file is positioned to "offset", relative to the current file position. If mode is specified as END, then the file is positioned to "offset", relative to the end of the file. If the final parameter "new position" is specified, the new file position will be stored to that variable.

ClearErrors
FileOpen $0 $INSTDIR\file.dat r
IfErrors done
FileSeek $0 -5 END
FileRead $0 $1
DetailPrint $1
FileClose $0
done:

Command introduced with NSIS v1.60