Sign in to follow this  

ignore this unless your on chat at the moment

This topic is 4665 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
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

This topic is 4665 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this