ignore this unless your on chat at the moment

Started by
4 comments, last by WizHarDx 19 years, 1 month ago

	ifstream instream;

	char szPath[MAX_PATH];
	GetModuleFileName(NULL,szPath,MAX_PATH);
	PathRemoveFileSpec(szPath);
	PathAppend(szPath, "priv.old.edb");
	instream.open (szPath, ios::in | ios::binary);

	if(instream.is_open())
	{
		char *buffer = new char[128];		
		while(!instream.eof())
		{
			instream.read(buffer,128);
			cout<<buffer;
		}
		delete [] buffer;

	}

who is it that keeps on nicking WizHarD name !! :P
Advertisement
muer's code paste
well guys it appears no one knows how to fix this, ill give you some information.

Basically one of our files is 1.8 GB and we just want to see whats in it b/c we believe it is corrupted. So im writing this simple app to stream in 128 bytes at a time and write it. But it won't work ?

please please please help me

thank-you in advance
Iain Fraser
who is it that keeps on nicking WizHarD name !! :P
How does it not work?
trying to cout a binary buffer isn't a good idea. it may or may not be null terminated, and even if it is, it's going to print garbage.
ya I know it will print garbage but we do just wanna see something at the moment.

when I put binary on it doesn't even allow the file to open. When its off it only reads like 4 bytes

thanks for the response
Iain
who is it that keeps on nicking WizHarD name !! :P

This topic is closed to new replies.

Advertisement