Solved

For directory search ?

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now