This function is actually incorrect. Let's say you have a file with 9500 lines and you want to split the file by 1000 lines. The currect code will make 9 files with 1000 lines per file... well what about the other 500 lines. There should be a tenth file with the remaining lines.
Here is the corrected run function:
$date = date("m-d-y");
Ben Yacoub Hatem - 2005-06-07 08:01:24 - In reply to message 2 from Matt McBride
Sorry I was off for long time. Thank you for your contribution, but you see there is no need to open the file twice using file() then fopen() ... just to count the missing lines. This information exist already in the variable $buffer. I have update the class so just check it again.