`nocreate' is not a member...

Hi…

I get this error when I run this simple program bellow. The program
compiles and runs perfectly under rtp 6.0.0 what am I missing??

Thanks…

Miguel.


QCC -lang-c++ -o test1 test1.C
test1.C: In function `int main()’:

test1.C:29: nocreate' is not a member of type std::basic_ios<char,std::char_traits >’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33

\

//… test1.C

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fstream.h>

using namespace std;


main()
{
int OpenMode = 1;
fstream *DataFILE;
char *FileName;

strcpy(FileName, “/home/saic/shm/xOO/testData.txt” );


if ( OpenMode > 0 )
{
DataFILE = new fstream( FileName,
ios::out|ios::trunc|ios::binary);
//…reset pointer to the beginning of the file

}
else if (OpenMode <= 0) //… Open for reading, used by server
{
//DataFILE->open( FileName, ios::in|ios::nocreate|ios::binary);
DataFILE = new fstream(
FileName,ios::in|ios::nocreate|ios::binary);
}
DataFILE->seekp(0, ios::beg);

if (!DataFILE)
{
printf("\nOpenDataFILE():…Cannot open output file %s \n", FileName);
}
//…clear the status flag
DataFILE->clear();


}

=================


\


my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.

Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com

I get this error when I run this simple program bellow. The program
compiles and runs perfectly under rtp 6.0.0 what am I missing??

Thanks…

Miguel.

QCC -lang-c++ -o test1 test1.C
test1.C: In function int main()': test1.C:29: nocreate’ is not a member of type
`std::basic_ios<char,std::char_traits >’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33

=============

//… test1.C

#include <stdlib.h
#include <stdio.h
#include <string.h
#include <fstream.h

using namespace std;

main()
{
int OpenMode = 1;
fstream *DataFILE;
char *FileName;
^^^^^^^^^

make that FileName[72];



strcpy(FileName, “/home/saic/shm/xOO/testData.txt” );

if ( OpenMode > 0 )
{
DataFILE = new fstream( FileName,
ios::out|ios::trunc|ios::binary);
//…reset pointer to the beginning of the file

}
else if (OpenMode <= 0) //… Open for reading, used by server
{
//DataFILE->open( FileName, ios::in|ios::nocreate|ios::binary);
DataFILE = new fstream(
FileName,ios::in|ios::nocreate|ios::binary);
}
DataFILE->seekp(0, ios::beg);

if (!DataFILE)
{
printf("\nOpenDataFILE():…Cannot open output file %s \n", FileName);
}
//…clear the status flag
DataFILE->clear();

}

=================

my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.

Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com

my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.

Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com

On a similar note ‘ios::text’ also produces an error message. Certain of the
ios definitions are redundant - perhaps they have been depreciated??? (what
do you say Colin?)

“Miguel Simon” <simon@ou.edu> wrote in message
news:3B4B84B0.7E1DC301@ou.edu

Hi…

I get this error when I run this simple program bellow. The program
compiles and runs perfectly under rtp 6.0.0 what am I missing??

Thanks…

Miguel.


QCC -lang-c++ -o test1 test1.C
test1.C: In function int main()': test1.C:29: nocreate’ is not a member of type
`std::basic_ios<char,std::char_traits >’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33

\

//… test1.C

#include <stdlib.h
#include <stdio.h
#include <string.h
#include <fstream.h

using namespace std;


main()
{
int OpenMode = 1;
fstream *DataFILE;
char *FileName;

strcpy(FileName, “/home/saic/shm/xOO/testData.txt” );


if ( OpenMode > 0 )
{
DataFILE = new fstream( FileName,
ios::out|ios::trunc|ios::binary);
//…reset pointer to the beginning of the file

}
else if (OpenMode <= 0) //… Open for reading, used by server
{
//DataFILE->open( FileName, ios::in|ios::nocreate|ios::binary);
DataFILE = new fstream(
FileName,ios::in|ios::nocreate|ios::binary);
}
DataFILE->seekp(0, ios::beg);

if (!DataFILE)
{
printf("\nOpenDataFILE():…Cannot open output file %s \n", FileName);
}
//…clear the status flag
DataFILE->clear();


}

=================


\


my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.

Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com