File::Temp, SQLite, and OS X

Paul Makepeace london.pm.org at paulm.com
Tue Nov 15 19:22:38 GMT 2005


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/


More information about the london.pm mailing list