![Picture of Christian Vigh Picture of Christian Vigh](/picture/user/676432.jpg)
Christian Vigh - 2016-07-13 13:10:32 -
In reply to message 3 from Dantigny francois
Hello François,
I made the changes according to your proposal.
The class is now able to handle random access files having a header at the beginning.
It can handle two situations :
- The caller already knows the size of the header : in this case, he can specify this size as the (new) third parameter of the class constructor, $header_size
- The caller does not know the size of the header, which may be specified in some fixed-part of the header itself. In this case the caller can specified a callback function instead of an integer value for the $header_size parameter. This function will be called whenever the Open() method will be called, and will allow the caller to extract header size information from the file and return it to the class.
I have added two examples, example-with-fixed-header.php and example-with-variable-header..php, which illustrate the above situations.
Please let me know if it fits your needs.