File listing and line counting