I have a directory with 1.3 Million files that I need to move into a database. I just need to grab a single filename from the directory WITHOUT scanning the whole directory.
This should do it:
readdir
Returns the name of the next entry in the directory. The entries are returned in the order in which they are stored by the filesystem.