0

is it at all possible to read song name from folder with c++? Don't care about other libraries, additional programs. Have noting against them, just that I have programmed c++ for a quite time and had given a task by a friend, sounds simple, but in reality, not so, and I want to do it. The task is to find out if the song, named in a text file, is in a folder as a .mp4, .avi....etc file. I know that, even that the names in the file and the names of songs are not exactly the same (Lower case - upper case symbols, numeration in from of the name etc), I could complete the task, if i could just read the name of the song in an array or string. Really looking forward to this, thanks. Choose c++, because its the most familiar to me, thought that it could be possible to read file names.

Have a great day, -Oskars

Oskars
  • 407
  • 4
  • 24
  • 1
    It will be OS specific, if you want to enumerate all media files in a folder. For windows : http://stackoverflow.com/questions/612097/how-can-i-get-the-list-of-files-in-a-directory-using-c-or-c – a_pradhan Feb 03 '15 at 20:00

1 Answers1

1

Most OS provides native libraries only in C, so you will end up using library this way or another. C++standard library does not support such filesystem library yet.

You can start with library for accessing files. One of them is boost::filesystem There is available recursive directory iterator. This library is expected to be similar to library that will be defined in next C++.

Luka Rahne
  • 10,336
  • 3
  • 34
  • 56