| | |
file unable to open
![]() |
•
•
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 |
action api array auto based beginner binary bitmap c++ c/c++ calculator challenge char class classes code coding compile console conversion count createcopyofanyfileinc delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game garbage givemetehcodez graph gui hmenu homeworkhelp homeworkhelper iamthwee ifstream input insert int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node noob output parameter pointer primenumbersinrange problem program programming project python random read recursion reference rpg sockets string strings temperature template test text text-file tree url variable vector video win32 windows winsock wordfrequency wxwidgets





