File CSV search

Introduction

Search an entry into a CSV file should be easy with PEAR::File package. I've recently used the version 1.2.0 and found a problem.

Once a csv file was opened, it won't be well closed, so a new search failed, especially if entry is before the latest entry searched.

Changelog

2005-06-07
* My patch still run with files :
http://cvs.php.net/co.php/pear/File/File.php?r=1.30
http://cvs.php.net/co.php/pear/File/File/CSV.php?r=1.21

* i have added file stack pointers dump on the test script.
* a live demo is now online.

2005-05-06
Bug 4295 opened and first proposal of patch was given

Patch to apply to File/CSV.php

Today (May, 6 2005) the PEAR CVS repository has this file CSV.php,v 1.20 2005/03/31 05:50:46 dufuz Exp

Have a look on method getPointer() on lines 128 to 155

Remove lines 130 to 135, 140 and 147 (like [3]) and all will run fine

Source Codes

Live demo