See opendir and readdir.
In reply to Re: How to read only limited number of files from a Directory by hdb in thread How to read only limited number of files from a Directory by shree