V
Venkat
Hi,
I am buried with the following issue on Linux platform, please let me know
if someone can help me out.
I am using ifstream to open and read the file, even i am able to open the
file i am NOT able to read the file contents.
The code i used is below.
fp = fopen(logFile, "a");
ifstream inFile;
inFile.open("/usr/local/cm/idp/test.txt");
if(!inFile.is_open())
{
fprintf(fp, "\n Unable to open the file");
}
else
{
fprintf(fp, "\n I can open the file");
}
std::string line;
getline (inFile, line);
fprintf("\nHi the Line is %s", line.c_str());
inFile.close();
fclose(fp);
It prints the following in my log file
I can open the file
Hi the Line is
The target file i.e. /usr/local/cm/idp/test.txt has all the permissions i.e.
777
Believe me the test.txt is not empty.
It used to work before but than it stopped working.
regards,
Venkat
I am buried with the following issue on Linux platform, please let me know
if someone can help me out.
I am using ifstream to open and read the file, even i am able to open the
file i am NOT able to read the file contents.
The code i used is below.
fp = fopen(logFile, "a");
ifstream inFile;
inFile.open("/usr/local/cm/idp/test.txt");
if(!inFile.is_open())
{
fprintf(fp, "\n Unable to open the file");
}
else
{
fprintf(fp, "\n I can open the file");
}
std::string line;
getline (inFile, line);
fprintf("\nHi the Line is %s", line.c_str());
inFile.close();
fclose(fp);
It prints the following in my log file
I can open the file
Hi the Line is
The target file i.e. /usr/local/cm/idp/test.txt has all the permissions i.e.
777
Believe me the test.txt is not empty.
It used to work before but than it stopped working.
regards,
Venkat