5

I want to know, or get a clue how to search through a directory in C++ with its own standard libraries or to see if it is possible at all.

Currently I have found several solution to searching directory, but they all use some external libraries such as this SO question:

recursive folder scanning in c++

How should we approach this?

Community
  • 1
  • 1
Mostafa Talebi
  • 8,825
  • 16
  • 61
  • 105
  • You are only going to find platform specific solutions - or boost, I reckon. There are some C++14 filesystem things in the pipes though: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3505.html – doctorlove Aug 26 '14 at 10:08
  • 4
    Treat boost as a kind of standard, then you have Boost.Filesystem :) – Mine Aug 26 '14 at 10:10

1 Answers1

8

There is no filesystem facilities in the C++ standard. There is a technical specification for it which may be included in a future version of C++.

Until then, you will have to use platform specific functions or a library that wraps them. Apparently the new proposal is almost the same as boost's API, so I recommend using boost even if it's ubiquitousness wasn't good enough reason already.

eerorika
  • 232,697
  • 12
  • 197
  • 326