- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi !
Excuse me for my english but I'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'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 'l_File.open(...)' 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]
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page