FMSeek (LabVIEW Manager Function)

MgErr FMSeek(fd, ofst, mode);

Purpose

Sets the current position mark for a file to the specified point, relative to the beginning of the file, the current position in the file, or the end of the file. If the point you specify is past the end of the file, the position mark is set to the end of the file. If the point you specify is before the beginning of the file, the position mark is set to the beginning of the file. If an error occurs, the current position mark does not move.

Parameters

Name Type Description
fd File File descriptor associated with the file.
ofst int32 New position of the current position mark. The position is the number of bytes from the beginning of the file, the current position mark, or the end of the file, as determined by mode.
mode int32 Position in the file relative to which FMSeek sets the current position mark for a file, using the following values:
  • fStart—Current position mark moves to ofst bytes relative to the start of the file. ofst must be greater than or equal to 0.
  • fCurrent—Current position mark moves ofst bytes from the current position mark. ofst can be positive, 0, or negative.
  • fEnd—Current position mark moves to ofst bytes from the end of the file. ofst must be less than or equal to 0.

Return Value

MgErr, which can contain the following errors. If you receive errors from LabVIEW Manager functions, most error names correspond to LabVIEW error codes.

Value Corresponding Error Code or Description
noErrNo error.
mgArgErr1
fEOF4
fIOErr6