SECCryptoFile::Seek

longSECCryptoFile::Seek(longlOff, UINTnFrom)

Moves to a specified location in the file. Only usable in ECB mode.

Defined in: CRYPTFIL.CPP

Return Value

If the requested position is legal, Seek returns the new byte offset from the beginning of the file. Otherwise, the return value is undefined and a CFileException object is thrown.

Parameters

lOff

Number of bytes to move the pointer.

nFrom

Pointer movement mode. Must be one of the following values:

CFile::begin

Move the file pointer lOff bytes forward from the beginning of the file.

CFile::current

Move the file pointer lOff bytes from the current position in the file.

CFile::end

Move the file pointer backward lOff bytes from the end of the file.

Comments

Repositions the pointer in a previously opened file. The Seek function permits random access to a file's contents by moving the pointer a specified amount, absolutely or relatively. No data is actually read during the seek. Note that this method may only be used if the SECCryptoFile was opened in SECCryptoFile::ECB mode.

When a file is opened, the file pointer is positioned at offset 0, the beginning of the file.

Developer Notes

Only usable in ECB mode.

See Also

SECCryptoFile  SeekToBegin  SeekToEnd