Re: Libpq coding assistance

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Scott Holmes <scottholmes(at)sbcglobal(dot)net>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Libpq coding assistance
Date: 2001-11-04 21:09:14
Message-ID: m3y9lmtf9h.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Scott Holmes <scottholmes(at)sbcglobal(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aaron Rouse 2001-11-04 22:49:07 Restoring data help
Previous Message Tom Lane 2001-11-04 20:38:49 Re: One more question about intervals