2
Contributors
3
Replies
22
Views
4 Years
Discussion Span
Last Post by venky019
0

Could you post your code for opening and reading the files? What specific problems are you having?

0

Hi This is what I'm doing after searching for files and getting total memory:

FileHandle fh;
FileError ferror;
unsigned char *Buff = new unsigned char[totalSize];

fh = FindFirstFile("*.bin", &FindFileData);

if(fh == INVALID_HANDLE_VALUE) {

  printf("Not founded");
}
else {
  printf("Found: %s", FindFileData.cFileName);
}

do
 {
   if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
  {

    printf("\nFound: %s\n", FindFileData.cFileName);
  }
  else
  {
     ferror = File::open(fh, FindFileData.cFileName, FILE_READ);
     ferror = File::read(fh, Buff, totalSize);
  }
 }
 while (FindNextFile(fh, &FindFileData) != 0);
0

I'm getting a breakpoint whenever I'm creating a buffer with total memory. Is this the right to read the multiple files?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.