Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

[fstream] Cannot opening file

Altera_Forum
Honored Contributor II
1,193 Views

Hi ! 

 

Excuse me for my english but I&#39;m a french speaker ! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/unsure.gif  

 

So here is my (simple http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/blink.gif ) problem : I can&#39;t open a file to write in some bytes ... ! 

 

The code used to do that : 

...# include <iostream.h># include <fstream.h> ... void WriteBinData(const char* _FileName) {  std::ofstream l_File;  int l_Counter = 0;    cout << "Opening/creating test file: " << _FileName << "\r\n";  l_File.open(_FileName, std::ios_base::binary);  if(l_File)  {    for(l_Counter = 0; l_Counter < 8; l_Counter++)      l_File.write(reinterpret_cast<const char*>(&l_Counter), sizeof(int));    l_File.close();  }  else cout << "\r\n*** Error opening file \"" << _FileName << "\"\r\n"; } 

 

It displays every time the error message ... ! The problem is the same in opening the file in text mode ... ! 

 

An idea of the problem ... ?! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif  

 

[EDIT] 

Altrough the program is continuing after the &#39;l_File.open(...)&#39; instruction, this one is no longer responding ... Because afer this instruction, the FTP server that is running in the same application is not avalaible ... ! 

[/EDIT]
0 Kudos
0 Replies
Reply