Implement fmemopen

duane ellis duane-newlib@duaneellis.com
Fri Jul 20 12:42:00 GMT 2007


Eric Blake wrote:
> So my implementation needs to be made a bit smarter - when in write-only mode, 
> remember the character being overwritten by the trailing NUL, then when seeking 
> to a different location, restore that byte (ie. the trailing NUL should always 
> correspond to the current position, rather than being a permanent artifact of 
> writing).
>   

Huh? That seems odd - what if I am writing bin bytes to the memory 
stream that purposely contain a NULL.

I do not have the POSIX docs - nor have I read them - but my gut tells 
me - I should be able to write bin data to this stream.

-Duane.




More information about the Newlib mailing list