Re: reg:lseek&read ..pls

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "sandhya" <sandhyar(at)amiindia(dot)co(dot)in>
Cc: "postgre" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: reg:lseek&read ..pls
Date: 2005-12-26 15:38:27
Message-ID: 9691.1135611507@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"sandhya" <sandhyar(at)amiindia(dot)co(dot)in> writes:
> But before that i need to know the size of the object from which i am =
> trying to get the contents.
> How can i do this?

Same way you'd do it for a Unix file: seek to the end, note the end
offset, seek back to the start and read.

... lo_open ...
lo_size = lo_lseek(conn, fd, 0, SEEK_END); // where's the end?
lo_lseek(conn, fd, 0, SEEK_SET); // go back to start

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2005-12-26 16:02:52 Re: vacuuming template0 gave ERROR
Previous Message Alain Rodriguez Arias 2005-12-26 14:16:13 Re: lo_ functions