|
| __construct ($filename, $mode='r+b') |
| Class constructor.
|
|
| seek ($offset, $whence=SEEK_SET) |
| Sets the file position indicator and advances the file pointer.
|
|
| tell () |
| Get file position.
|
|
| flush () |
| Flush output.
|
|
| close () |
| Close File object.
|
|
| size () |
| Get the size of the already opened file.
|
|
| lock ($lockType, $nonBlockingLock=false) |
| Lock file.
|
|
| unlock () |
| Unlock file.
|
|
| seek ($offset, $whence=SEEK_SET) |
| Sets the file position indicator and advances the file pointer.
|
|
| tell () |
| Get file position.
|
|
| flush () |
| Flush output.
|
|
| lock ($lockType, $nonBlockinLock=false) |
| Lock file.
|
|
| unlock () |
| Unlock file.
|
|
| readByte () |
| Reads a byte from the current position in the file and advances the file pointer.
|
|
| writeByte ($byte) |
| Writes a byte to the end of the file.
|
|
| readBytes ($num) |
| Read num bytes from the current position in the file and advances the file pointer.
|
|
| writeBytes ($data, $num=null) |
| Writes num bytes of data (all, if $num===null) to the end of the string.
|
|
| readInt () |
| Reads an integer from the current position in the file and advances the file pointer.
|
|
| writeInt ($value) |
| Writes an integer to the end of file.
|
|
| readLong () |
| Returns a long integer from the current position in the file and advances the file pointer.
|
|
| writeLong ($value) |
| Writes long integer to the end of file.
|
|
| readLong32Bit () |
| Returns a long integer from the current position in the file, advances the file pointer and return it as float (for 32-bit platforms).
|
|
| writeLong32Bit ($value) |
| Writes long integer to the end of file (32-bit platforms implementation)
|
|
| readVInt () |
| Returns a variable-length integer from the current position in the file and advances the file pointer.
|
|
| writeVInt ($value) |
| Writes a variable-length integer to the end of file.
|
|
| readString () |
| Reads a string from the current position in the file and advances the file pointer.
|
|
| writeString ($str) |
| Writes a string to the end of file.
|
|
| readBinary () |
| Reads binary data from the current position in the file and advances the file pointer.
|
|
seek |
( |
|
$offset, |
|
|
|
$whence = SEEK_SET |
|
) |
| |
Sets the file position indicator and advances the file pointer.
The new position, measured in bytes from the beginning of the file, is obtained by adding offset to the position specified by whence, whose values are defined as follows: SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.) SEEK_CUR is the only supported offset type for compound files
Upon success, returns 0; otherwise, returns -1
- Parameters
-
integer | $offset | |
integer | $whence | |
- Returns
- integer