WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Position the file pointer in an open file
This function will relocate the file pointer within an active file. Three different start position options are available.
$handle: Valid handle of a previously opened file
$offset: How far to move the pointer (bytes)
$whence: Seek type, starting position option, from where to move the pointer:
None
<? $fp=fopen("/index.cgi","r"); if ($fp) { fseek($fp,10,2); // position to 10 characters before the end of the file $data=fread($fp,10); print($data); fclose($fp); } else { print("File open failed\n"); } ?>
fopen() - Open a file for reading or writing
fseropen() - Open the serial port at the specified baud rate with optional parameters
f485open() - Open the RS-485 port at the specified baud rate and parity
fsockopen() - Open an internet socket connection with optional timeout
fread() - Read bytes from a file, stream or socket
fgets() - Return a single line from a file, stream or socket, with optional size limit
fwrite() - Write data to a file, stream or socket
feof() - Test if no more data is available in a file, stream or socket
filesize() - Return the size of a file, or the number of unread bytes in a stream or socket
ftell() - Return the current position of a file read/write pointer
fclose() - Close a file, stream or socket