Comment 5 for bug 6834

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Sat, 10 Jul 2004 19:15:12 +0200
From: Frank Lichtenheld <email address hidden>
To: Jayen Ashar <email address hidden>
Cc: <email address hidden>
Subject: Re: Bug#256314: Found the cause

On Sat, Jul 10, 2004 at 12:09:21PM -0400, Jayen Ashar wrote:
> > >If I try to tie an array read only, and the file does not exist, the
> > >file is created (wrong), but the tie fails (right).
> >
> > This behaviour is caused by the following code in DB_File.pm:
> >
> > # make recno in Berkeley DB version 2 (or better) work like
> > # recno in version 1.
> > if ($db_version > 1 and defined $arg[4] and $arg[4] =~ /RECNO/ and
> > $arg[1] and ! -e $arg[1]) {
> > open(FH, ">$arg[1]") or return undef ;
> > close FH ;
> > chmod $arg[3] ? $arg[3] : 0666 , $arg[1] ;
> > }
> >
> > So, it's a feature, not a bug ;)
>
> Okay, so it creates the file on purpose. But why does the tie fail?
>
> > >If I try to tie an array read only, and the file does exist, the tie
> > >fails with no error (wrong).
> >
> > Hmm, writing to a RDONLY array should probably cause an error, but it
> > doesn't. Seems like a bug, but I don't know enough about the Perl XS
> > interaction to spot the exact place where a change would be needed.
> >
>
> I didn't get to the point where I write yet. I'm just talking about
> tying. Why does the tie fail? And why isn't there an error?

For me none of the ties failed... Sometimes it could write to the file,
sometimes not, but the tie never failed.

Gruesse,
--
Frank Lichtenheld <email address hidden>
www: http://www.djpig.de/