Author Topic: File creation problem...  (Read 3469 times)


  • Guest
File creation problem...
« on: October 16, 2005, 11:41:04 pm »
Hi everyone.

I'm not sure why but the following code:
Code: [Select]
void CFile::initFile()
numRecords=0;"GameData.dat", ios::in | ios::binary);
    DataFile.seekg(0L,ios::beg); *)&numRecords,sizeof(int));
{"GameData.dat", ios::out | ios::binary);
DataFile.write((char *) &numRecords,sizeof(int));


Does not seem to create a GameData.dat file when it is called.  This only happens when I am using CodeBlocks to compile and run the project.  using MinGW g++ from the console with this : 'g++ main.cpp functions.cpp -o Game.exe' and then run Game.exe it creates the GameData file no problem.  MSVC 6 also compiles and runs the Program which creates a GameData.dat file. 

Apparently CodeBlocks is not configured properly or something?   I am using CodeBlocks RC-1.  I downloaded and setup MinGW 3.4.4 separtely and then had CodeBlocks auto detect it.

My operating system is Windows XP if that helps.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: File creation problem...
« Reply #1 on: October 17, 2005, 12:07:07 am »
The problem could be the file is being created somewhere else in your HDD. Try searching for that file in your HDD, but before that try in the Code::Blocks installation folder and see if it was created there.


  • Guest
Re: File creation problem...
« Reply #2 on: October 17, 2005, 12:19:19 am »

Good thinking Ceniza.  The file is being created somewhere else. 

Thanks a bunch!