agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
Examples on Large Objects
2+ messages / 2 participants
[nested] [flat]

* Examples on Large Objects
@ 1994-09-06 17:45  Raj Vadakkencherry <raj@CS.UCLA.EDU>
  0 siblings, 1 reply; 2+ messages in thread

From: Raj Vadakkencherry @ 1994-09-06 17:45 UTC (permalink / raw)
  To: legacy

Hi,

 Do you have source code examples for creating and using large objects
 from Unix files ? The ...src/bin/fsutils directory contains only an example
 for inversion large object.

Raj.

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Examples on Large Objects
@ 1994-09-06 18:35  jimbo@crseo.ucsb.edu
  parent: Raj Vadakkencherry <raj@CS.UCLA.EDU>
  0 siblings, 0 replies; 2+ messages in thread

From: jimbo@crseo.ucsb.edu @ 1994-09-06 18:35 UTC (permalink / raw)
  To: Raj Vadakkencherry <raj@CS.UCLA.EDU>; +Cc: legacy; jimbo@crseo.ucsb.edu


>Hi,
>
> Do you have source code examples for creating and using large objects
> from Unix files ? The ...src/bin/fsutils directory contains only an example
> for inversion large object.



Hello,


If you're familiar with Tcl you can use libpqtcl to manipulate Unix
large objects in a script.  Here's an example:


#
# test libpqtcl's large object interface
#

# copy /etc/motd to a new large object
set lo [PQlo open junk w+]
set fp [open /etc/motd]
PQlo copyin $fp $lo
close $fp

# copy the data back out to stdout
PQlo seek $lo 0
PQlo copyout $lo stdout

# now stat the large object and print the statbuf array to stdout
PQlo stat junk statBuf
parray statBuf

# dump a listing of files at the LO root to stdout
puts stdout [PQlo glob *]

# make a new directory and move the large object there
PQlo mkdir mydir
PQlo cd mydir
PQlo rename /junk /mydir/junk

# delete the large object and directory
PQlo unlink junk
PQlo cd /
PQlo rmdir mydir



Libpqtcl can be included in any Tcl or Tk application.  You can get it
at:

ftp://ftp.crseo.ucsb.edu/pub/libpqtcl.tar.Z



-Jim

 __________________________________________________________
  Jim Davidson                     |  jimbo@crseo.ucsb.edu
  CSL / Center for Remote Sensing  |  jimbo@sbitp.bitnet
  University of California         |  Phone (805)893-8475
  Santa Barbara, CA 93106          |  Fax           -2578

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1994-09-06 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1994-09-06 17:45 Examples on Large Objects Raj Vadakkencherry <raj@CS.UCLA.EDU>
1994-09-06 18:35 ` jimbo@crseo.ucsb.edu

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox