Other than iterating through each line and incrementing a counter (seems too resource-intensive), how can I find out how many lines are in a certain file?