HighTechTalks DotNet Forums  

How open a huge binary file

Dotnet Framework (Performance) microsoft.public.dotnet.framework.performance


Discuss How open a huge binary file in the Dotnet Framework (Performance) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Leticia Ortega Maynez
 
Posts: n/a

Default How open a huge binary file - 10-07-2004 , 12:39 PM






Hello,

I am traying to open a huge file, just I want to open it.
This is the code that I am using. I am using Visual C++ 6.0 compiler.


main()
{

char *path1= "C:\\Reconstruction\\quad_HIDAC_data\\Test_File.ls t";
char buffer[1024];
fstream fin; // object from fstream class
//ftream output;

fin.open(path1,ios::binary,ios::in);

if(!fin.is_open())
{
cout << "Fail....";
return 0;
}
else
{

for(long x = 0; x < 20000; x++ )
{
fin.read(buffer,1024);
}

fin.close();
}

}


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #2  
Old   
Bob Grommes
 
Posts: n/a

Default Re: How open a huge binary file - 10-07-2004 , 02:57 PM






You've made a statement but haven't asked a question. What do you need?

Also, is your question relevant to .NET performance?

--Bob

"Leticia Ortega Maynez" <lom248 (AT) hotmail (DOT) com> wrote

Quote:
Hello,

I am traying to open a huge file, just I want to open it.
This is the code that I am using. I am using Visual C++ 6.0 compiler.


main()
{

char *path1= "C:\\Reconstruction\\quad_HIDAC_data\\Test_File.ls t";
char buffer[1024];
fstream fin; // object from fstream class
//ftream output;

fin.open(path1,ios::binary,ios::in);

if(!fin.is_open())
{
cout << "Fail....";
return 0;
}
else
{

for(long x = 0; x < 20000; x++ )
{
fin.read(buffer,1024);
}

fin.close();
}

}


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
  #3  
Old   
Ben Sykes
 
Posts: n/a

Default Re: How open a huge binary file - 10-16-2004 , 05:03 AM





I am assuming that your code is not working.

Try replacing fin.open(path1,ios::binary,ios::in);

with fin.open(path1,ios::binary | ios::in);

I'm fairly sure fin.open takes only 2 parameters.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.