Here is a program demonstrating how to get the names of the top-level subdirectories in a given directory: