Purtroppo non va bene, è di gran lunga più ""pesante"" del loop :

$fd = fopen ($FileName, "r");
while(!feof($fd)){
$TotalRow++;
}