Is there any function or way to find out how many lines a file has, without having to open it? I need to split a file into two parts so that two processes read it at the same time. I will use the fseek () function to move the pointer to a certain position of the file, but I need to find out how many lines the file has to be split.