954,198 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

file unable to open

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
#include
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;
}
//****************************************************

sai365
Newbie Poster
1 post since Jul 2003
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You