2008-01-21 13:24:55     std::ofstream 254 bytes limit

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-01-21 13:24:55     std::ofstream 254 bytes limit

Slava Zhuiko (RUSSIAN FEDERATION)

Message: 49892   

 

Hi,

 

Why if buffer is > 254 then resulting file == 0?

 

#include <fstream>

 

int main()

 

{

 

std::ofstream fs;

 

char buf[254]; //try increase size

 

fs.open("test_file", std::ios::out | std::ios::binary);

 

fs.write(buf, sizeof(buf));

 

return 0;

 

}

 

Thanks in advance.

 

On PC it's working as expected.

 

uname -a

 

Linux blackfin 2.6.19.3-ADI-2007R1.1-svn #14 Mon Jan 21 16:12:20 MSK 2008 blackfin unknown

QuoteReplyEditDelete

 

 

2008-01-21 19:32:57     Re: std::ofstream 254 bytes limit

Mike Frysinger (UNITED STATES)

Message: 49903    it works for me on trunk, but that could be by accident

 

i dont have a copy of C++ ISO standard to refer to, but what if you try doing fs.close() after the fs.write()

QuoteReplyEditDelete

 

 

2008-01-23 10:18:22     Re: std::ofstream 254 bytes limit

Robin Getz (UNITED STATES)

Message: 50030    Slava:

 

This was a problem that we fixed on trunk. What release are you using?

 

-Robin

QuoteReplyEditDelete

 

 

2008-01-23 12:45:50     Re: std::ofstream 254 bytes limit

Slava Zhuiko (RUSSIAN FEDERATION)

Message: 50050    Robin, I'm using the latest release. I'm not ready to switch to svn, but if you can remember which files were fixed, let me know, please. I'll try to update respective files in the release. Thanks again.

QuoteReplyEditDelete

 

 

2008-01-24 14:36:20     Re: std::ofstream 254 bytes limit

Robin Getz (UNITED STATES)

Message: 50111    The history was tracked here:

 

http://blackfin.uclinux.org/gf/project/toolchain/forum/?action=ForumBrowse&forum_id=44&_forum_action=ForumMessageBrowse&thread_id=23255

 

If you are checked out from the branch, it should be fixed...

 

If you just downloaded the latest release files, it may need to be patched.

 

The urls for the patches are in that thread.

 

-Robin

Attachments

    Outcomes