Solved

For directory search ?

Posted on 2000-03-16
1
180 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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 …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

752 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