views:

79

answers:

1

What is the most efficient way to recursively list files in a specific directory and its subdirectories? Should I use the standard library, or use some third party?

I want this because I use v8 as a JavaScript engine, and I want to execute all scripts in some directory (and its subdirectories). If there's any built-in way to do that in v8, great :)

It should support Windows, Linux and OS X.

Thanks.

+5  A: 

For a generic cross-platform C++ solution, check out boost::filesystem

Cogwheel - Matthew Orlando
How can I do that with boost::filesystem?
TTT
@Excl, you can start by reading about it at the link Cogwheel gave you
Assaf Lavie
@Excl: the simple_ls example in particular would be worth a look
Cogwheel - Matthew Orlando
They need to update their tutorials to include `recursive_directory_iterator`.
Cubbi