file unable to open

Reply

Join Date: Jul 2003
Posts: 1
Reputation: sai365 is an unknown quantity at this point 
Solved Threads: 0
sai365 sai365 is offline Offline
Newbie Poster

file unable to open

 
0
  #1
Jul 28th, 2003
I am unable to open a file using the below code in c++. The code used to work before.
I am running this program in unix (sun c++ v4.2 compilers). The file I am reading currently is now > 2GB. I am able to read files < 2GB using this code. Is it because of a limit on the unix server? Please let me know the issue with this.

FYI, I had the same issue with the file size in perl. But I used pipe | to read files > 2GB.

Can somebody please help me resolve this issue.

//*******************************************************
#include <iostream.h>
#include <fstream.h>
int main()
{
char buffer[500];
ifstream inFile("FORDNEW.TXT.processed", ios::in);
// Check if there was an error opening the file
if (!inFile)
{
cout << "Unable to open the file\n";
return 1;
}
while (inFile >> buffer)
cout << buffer << endl;
inFile.close();
return 0;
}
//****************************************************
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC