This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

newbie: _findfirst bug or is it me?


hi everyone,

i'm a newbie that's been using egcs for windows, version 2.91.57 for 2
months. I have a dell PII 233 and everything has been fine until today. but
the following code does not work and i just cannot find anything wrong with
it:

#include <dir.h>
#include <iostream.h>

void main()
{
   int iHandle;
   int iResult;
   struct _finddata_t * find;

 
   iResult = _chdir ("c:\\");  
   iHandle = _findfirst ("*.txt", find); 

   if ((iHandle == -1)) 
      cout << "no files found.";
   else
   {      
      cout << find->name << "\n";
      while (!(iResult == -1))
      {
         iResult = _findnext (iHandle, find);
         cout << find->name << "\n";
      }
      _findclose (iHandle);
   }
}

it produces an ilegal operation if i run it. (crashes in the _findfirst). do
i need to do something different to use <dir.h>?? can anybody tell me what
am i doing wrong?

thanks,

__soup_dragon__

"Somebody help me, tell me where to go from here
Cause even Thugs cry, but do the Lord care?"
2Pac

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]