[26940] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8906 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 31 14:05:31 2006

Date: Tue, 31 Jan 2006 11:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 31 Jan 2006     Volume: 10 Number: 8906

Today's topics:
    Re: DBI and GZip database xhoster@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 31 Jan 2006 15:05:46 GMT
From: xhoster@gmail.com
Subject: Re: DBI and GZip database
Message-Id: <20060131100656.018$de@newsreader.com>

Dominique_Crétel <d.cretel@wyniwyg.com> wrote:
> Hello,
>
> I'm trying again !
> I have a gzip file containing DBase files like this :
>
> mydb.gz:
>      firstdir
>       +---seconddir
>             +---aaa.dbf
>             +---bbb.dbf
>             +---ccc.dbf
>             +---...

Are you sure that that is a gzip file? I don't believe gzip supports
archival of many files into one compressed file.

>
> This script below works fine if I uncompress it :
>
> -----------------
> #!/usr/bin/perl
>
> use DBI;
>
> my $dbh = DBI->connect("DBI:XBase:./firstdir/seconddir")
>      or die "error connecting to database :" . $DBI::errstr;
>
> my $sth = $dbh->prepare("SELECT col1, col2 FROM table1")
>      or die "SQL error SQL:".$dbh->errstr();
>
> $sth->execute or die "error while executing query:".$sth->errstr();
> ...
> -----------------
>
> Is it posible to work directly from the zip file ?
> (but arranged for DBI)

Almost surely not.  I'm guessing the file handle has to be seekable for
DBD::XBase, which compressed files generally aren't.

>
> -----------------
> #!/bin/perl -w
>
> my $file = "mydb.zip";
> open (FIC, "|gzip -d < $file")
>      or die "Cannot read file '$file'";

You pipe is on the wrong side.

open (FIC, "gzip -d $file |")

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8906
***************************************


home help back first fref pref prev next nref lref last post