searching directories in windows
how do you search a specified directory in windows32 ? is there a function that returns how many files and a list of their names or something similar ? i can''t find it anywhere in the documentation. thanks..
For Win32 stuff it''s always good to have a look at MSDN.
[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]
[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]
Lektrix.....I happen to be in Brighton too ! I am looking at MSDN...and as usual, finding it hard to understand how to use FindFirstFile and FindNextFile properly
Lektrix.....I happen to be in Brighton too ! I am looking at MSDN...and as usual, finding it hard to understand how to use FindFirstFile and FindNextFile properly
quote:Original post by gowron67
Lektrix.....I happen to be in Brighton too !
Hehe, cool!
quote:Original post by gowron67
I am looking at MSDN...and as usual, finding it hard to understand how to use FindFirstFile and FindNextFile properly
I''m sorry, I would help you but I''m not a Win32 programmer. I don''t know anything about the different data types and so forth. You''ll have to find someone who is a Win32 programmer. Anyone?
[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]
Slightly adapted from MSDN....
[edited by - NickB on February 9, 2003 10:29:18 AM]
#define _WIN32_WINNT 0x0400#include "windows.h"intmain(int argc, char *argv[]){ WIN32_FIND_DATA FindFileData; HANDLE hFind; // uses DOS style filters hFind = FindFirstFile("*.exe", &FindFileData); if(hFind != INVALID_HANDLE_VALUE) { do { // do something with the file here printf("Found File : %s", FindFileData.cFileName; // get the next file in the search sequence } while( FindNextFile(hFile, &FindFileData) ); FindClose(hFind); } return (0);}
[edited by - NickB on February 9, 2003 10:29:18 AM]
cheers NickB, exactly what I was looking for.
lektrix.....what are you doing in sunny brighton ? are you a pro. coder ?
lektrix.....what are you doing in sunny brighton ? are you a pro. coder ?
Heh, no, I''m at school, learning (supposedly). What you doing?
[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]
[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement