Jump to content
  • Advertisement
Sign in to follow this  
WizHarDx

ignore this unless your on chat at the moment

This topic is 4911 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

	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;

	}

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!