File::Temp, SQLite, and OS X

Matt Sergeant msergeant at messagelabs.com
Tue Nov 15 22:09:08 GMT 2005


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 
______________________________________________________________________


More information about the london.pm mailing list