0

I am looking for a way to get the file names of files in a specific folder. I have search and many people say they use the boost.filesystem. I do not know how to include this in my c++ file/package to be able to use it, or ever how to use it. Is there a different method that might have been implemented. I am using Visual Studio for building my C++ program.

It would also need to be able to prompt the user folder specific folder/file.

5
  • Of course you can live without boost. Keyword FindFirstFile, FindNextFile. Commented Apr 5, 2014 at 23:23
  • What's your particular problems with boost? There is a pretty good documentation available, and tons of tutorials. Also it should work out of the box with MSVC, just follow the installation instructions. Commented Apr 5, 2014 at 23:23
  • @πάνταῥεῖ It doesn't work out of the box with MSVC, or at least it didn't for me. Commented Apr 6, 2014 at 0:25
  • @Mohammad So what were your problems? Failed installation? Failed compilation due to missing include paths in your project? Failed linkage due to missing library search paths, or linking against the wrong library versions (debug/multithreaded)? Failed program executon due to mssing PATH settings to find the boost DLLs? What was the problem, if none of these mentioned? (these problems are well covered from google research and tutorials IMHO) Commented Apr 6, 2014 at 0:31
  • @user3403720 The problem with using the OS native API for filesystem handling is portablity of your program. If you're sure you'll never have to run in a different OS environment, you can well go with FoggyDay's suggestions. Commented Apr 6, 2014 at 0:38

1 Answer 1

2

One API available on almost all platforms is opendir()/readdir():

DOS programs used findfirst()/findnext()/findclose(), followed by FindFirst()/FindNext() in Win32:

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.