Ext.: Cfile::seek

Source: Internet
Author: User

Cfile::seek

Virtual Long Seek (long loff,uint nfrom);
throw (CFileException);

return value:
If the requested location is valid, seek returns the new byte offset from the beginning of the file. Otherwise the value is undefined and produces a cfileexception exception.

Parameters:

Loff The number of bytes moved by the pointer.
Nfrom The mode of the pointer movement, which can be one of the following values:
· Cfile::begin From the beginning of the file, move the pointer backwards loff bytes.
· Cfile::current From the current position, move the pointer backwards loff bytes.
· Cfile::end Move the pointer forward Loff bytes, starting at the end of the file. Note You must move to a file that exists, so loff should be negative. If positive, the end of the file is exceeded.


Description
Repositions a pointer in a previously opened file. The Seek function allows us to randomly access the contents of a file, which is done by moving the pointer through a fixed amount, and the pointer movement can be absolute or relative. The file was not actually read when it was found.
When the file is opened, the file pointer is at offset 0, which is where the file begins.

Example:
Example for Cfile::seek
extern CFile CFile;
LONG loffset = 1000;
LONG lactual = CFile. Seek (Loffset, Cfile::begin);

Ext.: Cfile::seek

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.