LINUX C PROGRAM - reading current directory, printing results based on file type (directory, executable program, ordinary file) : I am having a bit of trouble creating a C program that reads the current directory, prints the file path, and contents.

For each file found in the directory the contents should be printed based on whether they are a directory, a file, or executable.

I have the main components working just unsure how to sort the files output after using the opendir() / closedir() command 

eg. end output:

/home/documents/folder1

File:       help.txt

File:       me.txt

Executable: plz

File:       thankyou.c  
