gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.
MIT License
1.34k stars 173 forks source link

How to list files? #86

Closed paulocoutinhox closed 3 years ago

paulocoutinhox commented 3 years ago

Hi,

How to list files?

On Poco i do:

std::vector<std::string> SimpleFileHelperPlatformService::listFiles(const std::string &path)
{
    try
    {
        Poco::DirectoryIterator d(path);
        std::vector<std::string> files;

        d->list(files);

        return files;
    }
    catch (const std::exception &)
    {
        return {};
    }
}

Thanks for the great library.

paulocoutinhox commented 3 years ago

I see here:

https://stackoverflow.com/questions/612097/how-can-i-get-the-list-of-files-in-a-directory-using-c-or-c

Thanks