Rewind pointer locating problems

Source: Internet
Author: User
Tags rewind
Rewind pointer to locate the problem! It seems that the rewind pointer has an error. what is the problem? The code is as follows: & nbsp; $ fpstr = fopen (& quot; php: // input & quot;, & quot; rb & quot ;);... slightly $ bin = fread ($ fpstr, 2); // read-only 2 bytes... locate the problem with the rewind pointer!
It seems that the rewind pointer has an error. what is the problem?
The code is as follows:
$ Fpstr = fopen ("php: // input", "rb ");
...
$ Bin = fread ($ fpstr, 2); // read-only 2 bytes
...
Fseek ($ fpstr, 0); // error reported here

// Use $ fpstr Resource again
$ RealSize = stream_copy_to_stream ($ fpstr, $ tmp); // at this time, the newly created file is missing two bytes.

How to locate the pointer to the beginning of $ fpstr to complete the file.

------ Solution --------------------
$ Fpstr = fopen ("php: // input", "rb ");

Php: // input is the input stream
You cannot locate the stream.

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.