Advertisement

Reading filenames from a folder

Started by September 18, 2001 09:51 PM
2 comments, last by BurningGoat 23 years, 5 months ago
I'm making an mp3 player and I was wondering how I could read the filenames of the mp3s from my music folder into an array. Would I just open the folder like it's a file or is it more complicated than that? Any help would be greatly appreciated. P.S. I know that this doesn't sound like an opengl related problem, but I'm using opengl for the interface and for the background (synched to the music). Edited by - BurningGoat on September 18, 2001 10:54:44 PM
If you don't have anything to say, then don't say it at all.
Extract the Functions you need from here:

http://www.codeguru.com/files/fcompare.shtml

You''ll most likely want to look at AddDir()

HTH



"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..." -- Merrick

"It is far easier for a camel to pass through the eye of a needle if it first passes through a blender" -- Damocles
"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..." -- Merrick
Advertisement
Thanks man, I''ll check it out.
If you don't have anything to say, then don't say it at all.
Try these Win32 apis:

struct _finddata_t file;

std::string filespec = "C:\\MyMusic\\*.mp3";

long ffHandle = _findfirst( filespec.c_str(), &file );

if ( -1 != ffHandle )
{
AddToArray( file.name );

while( 0 == _findnext( ffHandle, &file ) )
{
AddToArray( file.name );
}
}

_findclose( ffHandle );



---
Visit Particle Stream Studios - Home of Europa, Tachyon and winSkin
---Visit InterfaceFX - Home of Europa, Tachyon and winSkin

This topic is closed to new replies.

Advertisement