agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: jimbo@crseo.ucsb.edu
To: Raj Vadakkencherry <raj@CS.UCLA.EDU>
Cc: postgres@postgres.Berkeley.EDU
Cc: jimbo@crseo.ucsb.edu
Subject: Re: Examples on Large Objects
Date: Tue, 06 Sep 94 11:35:11 -0700
Message-ID: <9409061835.AA21634@scorpii.s2k.ucsb.edu> (raw)
In-Reply-To: <9409061745.AA20754@oahu.cs.ucla.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.
==============================================================================
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: jimbo@crseo.ucsb.edu, raj@CS.UCLA.EDU
Subject: Re: Examples on Large Objects
In-Reply-To: <9409061835.AA21634@scorpii.s2k.ucsb.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox