Solved

For directory search ?

Posted on 2000-03-16
1
181 Views
Last Modified: 2010-04-02
I would find out if geret.exe exists under c:\game\ by programming.
How to?
Thx
0
Comment
Question by:huangyun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
Wyn earned 183 total points
ID: 2626844
Hellow ,
Here is a function I once wrote.You can use it to test if a file exist,plz notice you'd pass the name into it:
Here name is "geret.exe"
BOOL IsFileExist(char* name)
{
char Des[MAX_PATH]="c:\\game\\";
BOOL  Done;                     // Done searching for files?
HANDLE  FndHnd = NULL;   // Handle to find data.
WIN32_FIND_DATA FindDat;  // Info on file found.
strcat(Des,(const char*)name);
FndHnd =FindFirstFile(Des, &FindDat);
   if(!FndHnd)  //NO THIS FILE
   return FALSE;
   else{
   FindClose(FndHnd); // Close the find handle
   return TRUE;}
}

I think above is exact what you need.
Hope helpful
Regards
W.Yinan
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question