File::Temp, SQLite, and OS X

Paul Makepeace london.pm.org at paulm.com
Wed Nov 16 10:26:20 GMT 2005


Hi Matt - What do you mean? The directory is same, /tmp. If I manually
give a filename ('$n="/tmp/AAAAA" in the line below') to sqlite3 of the
same form rather than the one that comes from File::Temp it works.

At the same time, they both work on Linux without a hitch.

Paul

Je 2005-11-15 22:09:08 +0000, Matt Sergeant skribis:
> It's the directory, not the file itself. It needs to be able to create 
> a .journal file in that directory.
> 
> On 15 Nov 2005, at 14:22, Paul Makepeace wrote:
> 
> >Creating a file on OS X with File::Temp seems to somehow create a lock
> >that sqlite3 doesn't want to write to:
> >
> >  perl -MFile::Temp -le '$t = File::Temp->new() or die "tmp: $!"; 
> >print $n = $t->filename; $r = qx{sqlite3 $n < schema.sql}; print "$@ 
> >($r)"'
> >
> >This returns "SQL error: database is locked"
> >
> >My first workaround was to use DBI / DBD::SQLite but the $dbh->do() 
> >just
> >ended up hanging, which I'm assuming is related.
> >
> >I noted in the internals of File::Temp it doesn't explicitly target OS
> >X, just Classic...
> >
> >Anyone seen this / know a way around it that still makes use of
> >File::Temp and its various cleaning up and safety features?
> >
> >Paul
> >
> >-- 
> >Paul Makepeace .............................. 
> >http://paulm.com/inchoate/
> >
> >"What is a land fit for heros? To die a hard life."
> >   -- http://paulm.com/toys/surrealism/
> >
> >
> 
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________

-- 
Paul Makepeace .............................. http://paulm.com/inchoate/

"What is the correct way? Just another option."
   -- http://paulm.com/toys/surrealism/


More information about the london.pm mailing list