Zorro has some handy file functions, which you can easily wrap with a helper function.
http://zorro-project.com/manual/en/file_.htm

But how you would wrap them depends on what you are trying to do.

For example, you can convert a file into a char* string and change the first newline character '\n' to a null character '\0' to get the first line.

For last line, simply find the last '\n' and point to the character after it.

I might be able to demo this first thing in the morning tomorrow unless someone beats me to it.