Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

For directory search ?

Posted on 2000-03-16
1
Medium Priority
?
182 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 732 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

705 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