| | |
file unable to open
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2003
Posts: 1
Reputation:
Solved Threads: 0
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;
}
//****************************************************
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;
}
//****************************************************
![]() |
Similar Threads
- Unable to open input file with fstream (C++)
- Beginner's question - Unable to open "include" file (C++)
- Unable to open a video file!! (Windows NT / 2000 / XP)
- Unable to open Web Project '...'. The file path '...' does not correspond to the URL (ASP.NET)
- Unable to open Web Project '...'. The file path '...' does not correspond to the URL (Community Introductions)
- Unable to open some desktop icons, HJT Log. (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: set me some home work plz
- Next Thread: ** Need Help ** in a small C++ problem
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector visualstudio win32 windows winsock word wordfrequency wxwidgets





