#pseudocode while( readdir(DIR) ) { if is dot or dot-dot or is a directory print 'Found'. else print.Stop.}