Отв.: r+b filemode
oleg_moroz at yahoo.com
Fri May 27 05:00:19 UTC 2011
От: Joel Sherrill <joel.sherrill at oarcorp.com>
Кому: Oleg Moroz <oleg_moroz at yahoo.com>; "rtems-users at rtems.org" <rtems-users at rtems.org>
Отправлено: четверг, 26 май 2011 21:57
Тема: Re: r+b filemode
Do you have a complete small test case?
Someone else will likely have other ideas. I am on travel and just wanted to ask the obviuous questions.
Oleg Moroz <oleg_moroz at yahoo.com> wrote:
>Hello everyone, i have a trouble with opening file. i have opened the file with "wb" mode. Write to it 512 bytes. close it. after this open it with "r+b" mode. then trying:
>int i = ftell(file);
>after this i=0
>but when i'm opening file with "rb" mode - i=512. how i can use "r+b" mode?
int create_ring_buffer_file(char *filename)
if (outfile==NULL) return -1;
char *block=(char *)malloc(512);
int i = ftell(outfile); //i=0
int i = ftell(outfile); //i=512
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users