#include <stdio.h>
#include <dirent.h>
int main()
{
DIR *dir;
struct dirent *entry;
dir = opendir(".");
if (dir == NULL)
{
printf("Directory cannot be opened\n");
return 1;
}
printf("Files in directory:\n");
while ((entry = readdir(dir)) != NULL)
{
printf("%s\n", entry->d_name);
}
closedir(dir);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxkaXJlbnQuaD4KCmludCBtYWluKCkKewogICAgRElSICpkaXI7CiAgICBzdHJ1Y3QgZGlyZW50ICplbnRyeTsKCiAgICBkaXIgPSBvcGVuZGlyKCIuIik7CiAgICBpZiAoZGlyID09IE5VTEwpCiAgICB7CiAgICAgICAgcHJpbnRmKCJEaXJlY3RvcnkgY2Fubm90IGJlIG9wZW5lZFxuIik7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CgogICAgcHJpbnRmKCJGaWxlcyBpbiBkaXJlY3Rvcnk6XG4iKTsKCiAgICB3aGlsZSAoKGVudHJ5ID0gcmVhZGRpcihkaXIpKSAhPSBOVUxMKQogICAgewogICAgICAgIHByaW50ZigiJXNcbiIsIGVudHJ5LT5kX25hbWUpOwogICAgfQoKICAgIGNsb3NlZGlyKGRpcik7CiAgICByZXR1cm4gMDsKfQo=