Re: Libpq coding assistance

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: Libpq coding assistance
Дата
Msg-id m3y9lmtf9h.fsf@belphigor.mcnaught.org
обсуждение исходный текст
Ответ на Libpq coding assistance  (Scott Holmes <scottholmes@sbcglobal.net>)
Список pgsql-general
Scott Holmes <scottholmes@sbcglobal.net> writes:

> ------------
>
>   lobj_fd = lo_open(conn, lobjId, INV_WRITE);
>
>   while ((nbytes = read(fd, buffer,BUFSIZE)) > 0)
>     {

>     }
>
> ------------
>
> I need to change the read() statement to use ReadFile, thus:
>
> ------------
>   lobj_fd = lo_open(conn, lobjId, INV_WRITE);
>
>   while (ReadFile(fd, buffer, BUFSIZE, &nbytes, NULL)!=EOF )
>     {

>     }
> --------------
>
> This, of course, doesn't work.  The program is reported as no longer
> responding.  An infinite loop I suspect. If anyone is doing this or
> knows how to code it, I would be grateful.

Sounds like ReadFile (a Windows call?) isn't behaving the way you
think it does.  Write some test code and play around with it until you
understand how it works.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

В списке pgsql-general по дате отправления:

Предыдущее
От: elwood@agouros.de (Konstantinos Agouros)
Дата:
Сообщение: Re: One more question about intervals
Следующее
От: "Aaron Rouse"
Дата:
Сообщение: Restoring data help